If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > to find duplicates

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-19-02, 12:04
raf raf is offline
Registered User
 
Join Date: Jul 2002
Posts: 214
to find duplicates

hi,
I've a table with 2 columns:
ID, NAME
I'd like to find same name with more ID
How can I write this query?

Thanks
Raf
Reply With Quote
  #2 (permalink)  
Old 12-19-02, 12:16
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: to find duplicates

Quote:
Originally posted by raf
hi,
I've a table with 2 columns:
ID, NAME
I'd like to find same name with more ID
How can I write this query?

Thanks
Raf
SELECT NAME
FROM table
GROUP BY NAME
HAVING COUNT(DISTINCT ID) > 1;
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On