One way would be to create a calculated column that concatenates both fields with the smallest first, so you can order and distinct that column.
Although that may work, I guess there has to be a better way.
pritaeas
Posting Expert
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
Something like:
SELECT field1, field2, IF(field1 < field2, CONCAT(field1, '-', field2), CONCAT(field2, '-', field1)) AS field3
FROM table
GROUP BY field3
ORDER BY field3
This may not work for you in all case, but it will give you the idea.
pritaeas
Posting Expert
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875