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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 self join field compare

Author  Topic 

qman
Constraint Violating Yak Guru

442 Posts

Posted - 2007-10-26 : 10:14:21
I want to compare a column within our COMPANY table to see if a duplicate value exists. I assume I should use a self join? The column I want to check for duplicates is MCIC. Thanks

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-10-26 : 10:18:29
Select MCIC from COMPANY
group by MCIC
having count(*)>1

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -