Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Need a SELECT query

Author  Topic 

rico16135
Starting Member

11 Posts

Posted - 2008-04-15 : 12:38:07
Hi, I have a database that contains calls. They have a unique id of course, but its not the call_num field. There can be multiple instances of a call_num, which would indicate a change in a call. Now, how would I write a SELECT query to find all calls that have duplicate entries, and only display the call_num of those particular calls as my output. Thx

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-04-15 : 12:42:35
SELECT call_num FROM YourTable GROUP BY call_num HAVING Count(*) >1
Go to Top of Page

rico16135
Starting Member

11 Posts

Posted - 2008-04-15 : 13:33:45
you're awesome, ty
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-04-15 : 13:36:09
quote:
Originally posted by rico16135

you're awesome, ty


Glad that i could help.
Go to Top of Page
   

- Advertisement -