http://www.perlmonks.org?node_id=187615


in reply to Re: Re: Merging SQL Results
in thread Merging SQL Results

From my rather hazy recollection of SQL:
SELECT ir.name, ir.address, ge.name, ge.address, ir.age, ge.age FROM table1 AS ir OUTER JOIN table1 AS ge ON ir.age = ge.age WHERE ir.age > 20 AND (ir.country = 'Ireland' AND ge.country = 'Germany') OR (ge.country = 'Germany' AND ir.country IS NULL) OR (ir.country = 'Ireland' AND ge.country IS NULL)
I haven't been able to test this, so please let me know if it works!