Thursday, March 13, 2008

Find duplicate rows in a table?

  1. Find duplicate rows in a table? OR I have a table with one column which has many records which are not distinct. I need to find the distinct values from that column and number of times it’s repeated.
    SELECT sid, mark, COUNT(*) AS Counter
    FROM marks
    GROUP BY sid, mark
    HAVING (COUNT(*) > 1)

No comments: