select Name,Email,WindowId,Count(*) as cnt from [Resources] group by Name,Email,WindowId having count(*) > 1
delete duplicate records
ALTER PROCEDURE [dbo].[DeleteDuplicateResource]
AS
BEGIN
DELETE FROM [Resources]
WHERE ID NOT IN
(
SELECT MAX(ID)
FROM [Resources]
GROUP BY Email
);
END
No comments:
Post a Comment