标签:sql stackoverflow 去重
MyTable
-----------
RowID int not null identity(1,1) primary key,
Col1 varchar(20) not null,
Col2 varchar(2048) not null,
Col3 tinyint not null
DELETE MyTable
FROM MyTable
LEFT OUTER JOIN (
SELECT MIN(RowId) as RowId, Col1, Col2, Col3
FROM MyTable
GROUP BY Col1, Col2, Col3
) as KeepRows ON
MyTable.RowId = KeepRows.RowId
WHERE
KeepRows.RowId IS NULL
CONVERT(uniqueidentifier, MIN(CONVERT(char(36), MyGuidColumn)))
标签:sql stackoverflow 去重
原文地址:http://blog.csdn.net/lizeyang/article/details/41555105