I have an Access 2010 database which stores IP addresses of source and destination machines. If I have the following entries in my database
|source | destination| |--------------------------------| | A | B | | B | A | | A | B | | C | D | | D | D |
Is there any query to select unique pairs? That is, the output of the query should be
|source | destination| |----------------------------------| | A | B | | C | D |
Your question seems to imply two things:
When listing source/destination pairs you only want to see the pairs in one direction, e.g., (A,B) but not (B,A).
The list should omit pairs where the source and destnation are the same, e.g., (D,D)
In that case the query...
...when run against [SomeTable] containing...
...will produce:
select unique source, destination from YourTable
or
select distinct source, destination from YourTable
or
select source, destination from YourTable group by source, destination
Use GROUP BY clause