delete from [tag] where id in(select id from table where paggeid = ?? group by id having count(1) = 1)
我试过 delete from [tag] where id in(select tagid from [tagmap] where pageid=@info_id group by tagid having count(*)=1)但 group by tagid having count(*)=1 是没有效的 好像是先pageid=@info_id的结果再group by 但我想要的结果是group by是对整个表的谢谢了
我有个方法delete from [tag] where id in(select tagid from [tagmap] where tagid in(select tagid from [tagmap] where pageid=@info_id) group by tagid having count(*)=1)这个是能实现的 但好像效率好像很差啊
from table
where paggeid = ??
group by id
having count(1) = 1
delete from [tag] where id in(这个集合)或者能做到同样效果的也行
谢谢了
where tagid in(select tagid from xxx where pageid='aa' group by tagid having(count(*)=1))
where id in (select id from t2)
and pageid=???
我想要的是在表中找pageid等于指定值,而且其tagid值在表中只有一个的tagid集合
from table
where paggeid = ??
group by id
having count(1) = 1)
delete from [tag] where id in(select tagid from [tagmap] where pageid=@info_id group by tagid having count(*)=1)但 group by tagid having count(*)=1 是没有效的
好像是先pageid=@info_id的结果再group by
但我想要的结果是group by是对整个表的谢谢了
但好像效率好像很差啊