Wednesday, March 28, 2012

Remove Duplicate Data but Keep One

I have the following:

ID FNAME LNAME
1 John Doe
1 John Doe
1 John Doe
2 Joe Doe
2 Joe Doe
2 Joe Doe
3 John Jones
4 Foo Foo

I would like to end up like the following:

ID FNAME LNAME
1 John Doe
2 Joe Doe
3 John Jones
4 Foo Foo

Thanks for any advice
JESELECT DISTINCT * INTO someothertable FROM yourTable

DROP yourTable

RENAME someothertable TO yourTable

No comments:

Post a Comment