首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

下列语句如何修改啊

2012-03-21 
下列语句怎么修改啊?sg_clnt_clientshare记录了客户共享的信息现要删除共享人等于客户所有人的记录delete

下列语句怎么修改啊?
sg_clnt_clientshare记录了客户共享的信息
现要删除共享人等于客户所有人的记录

delete from sg_clnt_clientshare a where a.shareuserid = (select b.operator from sg_clnt_client b where b.customerid = a.clientid)

[解决办法]
delete a 
from 
sg_clnt_clientshare a,sg_clnt_client b 
where 
b.customerid = a.clientid and a.shareuserid = b.operator

热点排行