RE: SQL to find duplicate rows...

2001-12-07 Thread HAWKINS, JAMES W [IT/1000]
Thank you everyone! We found the culprits Jim __ Jim Hawkins Oracle Database Administrator Data Management Center of Expertise Pharmacia Corporation 800 North Lindbergh Blvd. St. Louis, Missouri 63167 Work (314) 694-4417 Cellular

RE: SQL to find duplicate rows...

2001-12-06 Thread Jack C. Applewhite
Jim, An option that handles multiple duplicates is: Delete >From MyTable Where (MyColumn,RowID) In ( Select MyColumn,RowID From MyTable Minus Select MyColumn,Min(RowID) From MyTable Group By MyColumn ); You could use Max(RowID) as well, depending on your needs. Jack ---

RE: SQL to find duplicate rows...

2001-12-06 Thread Jack C. Applewhite
Jim, Oops! Right after I sent this, I saw that you asked to find, not delete, duplicates. Sorry, I've spent the last two days de-duping a bunch of tables, so I've got deletion on the brain. How about: Select SomeColumn >From MyTable Where MyColumn In ( Select MyColumn From My Table Gr

RE: SQL to find duplicate rows...

2001-12-06 Thread Jamadagni, Rajendra
select column1, count(*) from my_table group by column1 having count(*) > 1 __ Rajendra Jamadagni MIS, ESPN Inc. Rajendra dot Jamadagni at ESPN dot com Any opinion expressed here is personal and doesn't reflect that of ESPN Inc. QO