DELETE FROM [TCX_1710_SHZJ].[dbo].[PR_BindingTray]
WHERE 1=1
AND SNum in (SELECT * FROM ( (SELECT SNum FROM [TCX_1710_SHZJ].[dbo].[PR_BindingTray] GROUP BY SNum HAVING COUNT( SNum )>1) ) a)
AND id not in (SELECT * FROM ( (SELECT MIN(id) ids FROM [TCX_1710_SHZJ].[dbo].[PR_BindingTray] GROUP BY SNum HAVING COUNT(SNum)>1) ) b)

04-28 20:29