Solved

How do i find duplicate guid values

Posted on 2010-11-30
3
449 Views
Last Modified: 2012-08-13
Hi
Is there a way for me to return me to find duplicate unique identifiers in a table.

So for example say we have the the following fields in a table i.e. ID, ClientID, Name

Lets say ClientId is a unqiueIdentifer and i want to return all clientids which are contained in the table more than once?

Thanks
Webbo
0
Comment
Question by:Webbo_1980
  • 2
3 Comments
 
LVL 8

Expert Comment

by:Bob Hoffman
ID: 34239413
select a.* from table a
where (select count(*) from table b where b.clientId = a.clientId) > 1
0
 
LVL 6

Accepted Solution

by:
hyphenpipe earned 500 total points
ID: 34239810
select client_id, count(*) from table
 group by client_id
 having count(*) > 1
0
 
LVL 6

Expert Comment

by:hyphenpipe
ID: 34239833
Replace my client_id column name with your ClientID column name.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question