sql批量去重语句
----查询重复数据
SELECT [1].tmStr,[1].flowId FROM dbo.table AS [1]
INNER JOIN dbo.table AS [2] ON [1].tmStr = [2].tmStr where [2].cls= 1
AND [1].flowId > [2].flowId and [1].cls= 1
-----删除重复数据
delete table
where flowId in (
SELECT [1].flowId FROM dbo.table AS [1]
INNER JOIN dbo.table AS [2] ON [1].tmStr = [2].tmStr where [2].cls= 1
AND [1].flowId > [2].flowId and [1].cls= 1
)

浙公网安备 33010602011771号