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 2000 Forums
 SQL Server Development (2000)
 QUERY in finding "unidentical" duplicate records

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-06-07 : 07:31:27
newuser1960 writes "Hi,
I am trying to find rows in my SQL Server table where important details on duplicate records do not match each other (i.e MemberID is not Unique in this table as there could be several enries for one member, but for each of these duplicate, the FirstName and Surname should be the same).

So, If MemberID = 123
and Surname = SMITH
Then all other rows with MemberID 123 should have Surname SMITH.

Can you please help with this query. This table in populated manually and I need to find typo errors.
Thank you"

Amethystium
Aged Yak Warrior

701 Posts

Posted - 2004-06-07 : 07:45:27
[code]
select
a.MemberID, a.Surname, b.Surname
from
yourTable a,
yourTable b
where a.MemberID = b.MemberID
and a.Surname <> b.Surname
[/code]
Go to Top of Page
   

- Advertisement -