SQL SELECT DISTINCT (Need WHOLE record, not field)
Posted on 2007-04-08
If I have a table with about 7000 records. One of the fields is called 'personname' and I want a 'DISTINCT' list of all the people I would: SELECT DISTINCT personname from TheTable
THe problem is that I dont want the one field back, I want the entire record.
What I'm trying to do is cleanse a database of duplicate people and write it into a new table. i.e.
SELECT DISTINCT personname, * INTO CLeanTable FROM TheTable
Problem is, it doesnt work like this :-( I just need one record per person.
Can someone help me with this?