I want to extract all rows from a database table, where the rows cross reference each other.
My table contains 2 rows: ref1andref2
Example table:
ID ref1 ref2
01 23 83
02 77 55
03 83 23
04 13 45
In this case, I want my query to return only rows 01 and 03, because they cross reference each other.
Is this possible using a single query, or will I need to manually iterate over the entire table?
I am using MySQL.
source
share