I'm trying to teach myself and better understand alternative methods to a UNION and discover when I can use joins.
As I'm playing with this I can't seem to get what I want without a UNION. Is it possible to write this in a single query?
SELECT DISTINCT a.id
FROM table1 a, table2 b
WHERE a.id = b.id
AND a.ind IS NULL
AND b.year >= '2017'
AND b.code IN ('01','02','03')
AND b.flag NOT IN ('F','L')
UNION
SELECT DISTINCT a.id
FROM table1 a, table3 c
WHERE a.id = c.id
AND a.ind IS NULL
AND c.area = 'MAIN'
AND SYSDATE >= c.start
Thanks in advance for any guidance or help.