22,209
社区成员
发帖
与我相关
我的任务
分享
delete from Q_qq where ID not in(select min(ID) from Q_qq group by Qno having count(Qno)>=1)
delete tmp from( select row_num = row_number() over(partition by Qno,Qqno order by Qtime asc) from Q_qun where Qtime>getdate()-1) tmp where row_num > 1
delete from Q_qq
where EXISTS (SELECT *
FROM Q_qq t
WHERE t.Qno = Q_qq.Qno
AND t.ID < Q_qq.ID)