Finding repeated data

pdbowling

Registered User.
Local time
Today, 21:35
Joined
Feb 14, 2003
Messages
179
Hello everyone.
I need to run a query to do this:

Table structure:

row..Field1(txt).....Field2(txt).....Field3(num)
1.....x..................y..................1
2.....xx................yy.................2
3.....xxx...............yyy...............5
4.....xx................yy.................10
5.....x..................y..................20
..
..
.

I want to find instances where Field1 and Field2 both are equal. ie
Match row 1 with row 5 and row 2 with row 4 for millions of records. This seems like it should be easy, I'm just having a block today.
Thanks all.
 
Like this?

SELECT
tblFields.Fld1
, tblFields.Fld2
, tblFields.Row
, tblFields.Fld3

FROM
tblFields

WHERE
(((tblFields.Fld1) In (SELECT [Fld1]

FROM
[tblFields] As Tmp

GROUP BY
[Fld1],[Fld2] HAVING Count(*)>1
And [Fld2] = [tblFields].[Fld2])))

ORDER BY
tblFields.Fld1, tblFields.Fld2;

HTH ;)
 
Thank you.
PB
 

Users who are viewing this thread

Back
Top Bottom