Delete duplicate records

PHOTO EMBED

Fri Sep 23 2022 23:26:41 GMT+0000 (UTC)

Saved by @dhfinch #sql #sqlserver

delete
FROM ManImp
WHERE ID NOT IN
(
    SELECT MAX(ID)
	FROM ManImp
	GROUP BY DT
)
content_copyCOPY

Retains all records that are MAX(ID) for the group of DT