Duplicates/Not duplicates

A

Anna

Hi,

Is it possible to search for records that are duplicates
in some fields and NOT in another (e.g records with the
same DOB but not the same surname (leaving out those with
same DOB and surname))?
Does this make sense?

Thanks,

Anna
 
M

Michel Walsh

Hi,


SELECT a.*, b.*
FROM myTable As a INNER JOIN myTable As b
ON (a.DOB=b.DOB AND a.Surname>b.Surname)


Since if a <> b, we also have b<>a, but in this case, I assumed you wish to see the combination
just once, not twice, I used > instead of <>.


Hoping it may help,
Vanderghast, Access MVP
 
A

Anna

Thanks, I'll give it a bash!

Anna
-----Original Message-----
Hi,


SELECT a.*, b.*
FROM myTable As a INNER JOIN myTable As b
ON (a.DOB=b.DOB AND a.Surname>b.Surname)


Since if a <> b, we also have b<>a, but in this case, I
assumed you wish to see the combination
 
Top