Solved

How do i find duplicate guid values

Posted on 2010-11-30
3
446 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now