Solved

How do i find duplicate guid values

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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.

790 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