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
 where 1 number has 2 ID's?

Author  Topic 

FightingTiger
Starting Member

23 Posts

Posted - 2012-08-01 : 14:23:26
I have a an acctnumber that was assigned two different acctIDs is there a way to set up a case statement or a where clause that would allow me to pull back any acctnumber that has more than 1 AcctNumber?

robvolk
Most Valuable Yak

15732 Posts

Posted - 2012-08-01 : 14:25:50
SELECT AcctNumber
FROM myTable
GROUP BY AcctNumber
HAVING COUNT(DISTINCT AcctID)>1
Go to Top of Page

FightingTiger
Starting Member

23 Posts

Posted - 2012-08-01 : 14:30:37
Thank you very much.
Go to Top of Page
   

- Advertisement -