PDA

View Full Version : eliminating duplicate rows


boeing747fp
07-30-2004, 01:43 PM
is there a way i could query the database to find all duplicated rows based on the column `name` ?

raf
07-30-2004, 02:01 PM
select count(*) numrecords from table group by name order by numrecords desc

will give you the frequency of all names. If you only need the ones with a count higher than 1 then use

select count(*) numrecords from table group by name having numrecords > 1 order by numrecords desc