WITH g AS ( SELECT ROW_NUMBER() OVER(PARTITION BY city, state, zip ORDER BY city, STATE, zip) AS row FROM dbo.Geography) DELETE FROM g WHERE row > 1;
Tuesday, December 17, 2013
Delete Dupes
Subscribe to:
Posts (Atom)
Mark Stein's blog chronicling daily things in his life including Crockett (his beagle/basset hound dog), social happenings, home remodeling projects, photography, outdoor adventures, concert reviews, guitar playing and oh... work
WITH g AS ( SELECT ROW_NUMBER() OVER(PARTITION BY city, state, zip ORDER BY city, STATE, zip) AS row FROM dbo.Geography) DELETE FROM g WHERE row > 1;