SET ROWCOUNT 1
WHILE 1=1
BEGIN
DELETE FROM [dbo].[Demo]
WHERE [Id] IN
(
select d1.Id
from [Demo] d1
where exists (select 1 from [Demo] d2 where d1.[EId]=d2.[EId] and d1.[RId]=d2.[RId] group by d2.[EId],d2.[RId] having count(1)>1)
)
IF @@ROWCOUNT=0
BREAK
END
SET ROWCOUNT 0
时间: 2024-10-24 03:48:33