Thursday, July 01, 2010

Note to myself to delete duplicates

Taken directly from Brian's page and added here so I don't have to keep searching for this the one time a year that I need it,

delete T1
from MyTable T1, MyTable T2
where T1.dupField = T2.dupField
and T1.uniqueField > T2.uniqueField

No comments :