按理说,应该从 下面的两个select SQL
中取一个得到idx
,然后再执行delete from user where idx in (xxx,xxx);
即可
但是,我想一次性删除,即不再另外运行一条 delete from
语句
get的两条语句均可以。但是将里面的select * from
改为 delete from
就不成功了,
delete from user b join (select * from user a where idx in (29,35)) c on (b.source_user = c.source_user and b.target_user = c.target_user) or (b.source_user = c.target_user and b.target_user = c.source_user);
select a.*from user a join user bon((b.source_user = a.source_user and b.target_user = a.target_user) or (b.source_user = a.target_user and b.targ优艾设计网_PS百科et_user = a.source_user))where b.idx in (29,35);
select b.*from user bjoin (select * from user a where idx in (29)) con (b.source_user = c.source_user and b.target_user = c.target_user) or (b.source_user = c.target_user and b.target_user = c.source_user)
精彩评论