I have a table from which I need to select all records with a 'matching pair of fields'.
For example my table contains the following structure, and the fields I'm matching are FIELD1 and FIELD3
ID FIELD1 FIELD2 FIELD3
1 Bob Ted Reg
2 Bob Peter
3 Bob Chris Peter
4 Ted Jane Eric
5 Ted Jane Robert
6 Ted Rachel Eric
In this instance, I want my query to return the following results (ideally, grouped).
FIELD1 FIELD3
Bob Peter
Ted Eric
How do I do this ?
For example my table contains the following structure, and the fields I'm matching are FIELD1 and FIELD3
ID FIELD1 FIELD2 FIELD3
1 Bob Ted Reg
2 Bob Peter
3 Bob Chris Peter
4 Ted Jane Eric
5 Ted Jane Robert
6 Ted Rachel Eric
In this instance, I want my query to return the following results (ideally, grouped).
FIELD1 FIELD3
Bob Peter
Ted Eric
How do I do this ?