Home » RDBMS Server » Server Administration » Re: sql query
Re: sql query [message #375071] Mon, 23 July 2001 19:27 Go to next message
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.
Re: sql query [message #375116 is a reply to message #375071] Fri, 27 July 2001 09:15 Go to previous message
Shukla
Messages: 5
Registered: July 2001
Junior Member
thanks.....
Previous Topic: Re: How can i make a parametarize filename in spool?
Next Topic: Re: connect string
Goto Forum:
  


Current Time: Fri Jul 05 10:54:48 CDT 2024