Sunday, June 22, 2008

duplicate rows in table

Hi ..
the query to find the duplciate rows in the table
Format:
select * from tablename a where 1 <
(select count(columnname) from tablename b where a.columnName = b.columnName)
Example:
select * from T_PROJECT_DETAILS a where 1 <
(select count(a_id) from T_PROJECT_DETAILS b where a.a_id = b.a_id)