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.
ch9862 Yak Posting Veteran
76 Posts
declare @a table (id int, cde char(1))insert @aselect 1, 'A' union allselect 2, 'D' union allselect 2, 'A' union allselect 3, 'Z'
2, 'D'2, 'A'
select @a.id, @a.cdefrom @ainner join ( select id, count(*) as cnt from @a group by id ) as con @a.id=c.idwhere c.cnt > 1
SQLTeam.com Articles via RSS
SQLTeam.com Weblog via RSS
- Advertisement -
Articles
Forums
Blogs
Contact Us
About the Site