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)