读书人

下列语句如何修改啊

发布时间: 2012-03-21 13:33:15 作者: rapoo

下列语句怎么修改啊?
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

读书人网 >SQL Server

热点推荐