You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

Duplicate row errors

2 replies [Last post]
Bhavya's picture
User offline. Last seen 9 years 3 days ago. Offline
Joined: 03/19/2012
Posts: 3

How can v check for duplicate rows in a record?

Saiyed's picture
Saiyed (not verified)
Re: Duplicate row errors

SELECT col1, col2,col3,count(col3)--put the last column of duplicate combination in Count()
FROM table1
GROUP BY col1,col2,col3

Rahul Khandelwal's picture
Rahul Khandelwal (not verified)
Re: Duplicate row errors

if database is oracle try this.
self join
select A.key1, A.key2... from TABLE A, TABLE B where A.key1= B.key1 and A.key2 = B.key2 ... and A.ROWID <> B.ROWID