Re: sql query [message #375071] |
Mon, 23 July 2001 19:27 |
Sudhakar Atmakuru
Messages: 58 Registered: May 2001
|
Member |
|
|
Try with HAVING COUNT(*)>1 option with GROUP BY clause. If any two rows have exactly same column contents, your query with HAVING COUNT(*)>1 should return the rows whose occurance has more than once. If you think only a few or some of the columns could be duplicate with of other rows, then try with only those columns in GROUP BY clause and with the HAVING COUNT(*)>1 like
SELECT COL1,COL2,COL3,COL4,COL5,COL6,COUNT(*) FROM TAB_1 GROUP BY COL1,COL2,...COL6 HAVING COUNT(*)>1;
Remember, include only the columns those could be duplicate in the SELECT or GROUP BY column list. The GROUP BY clause expects the SELECTed columns to be grouped values. Try it out. This should work and take less time.
|
|
|
|