title: Alternative to UNION clause
body: <p>I'm trying to teach myself and better understand alternative methods to a UNION and discover when I can use joins.</p>
  
  <p>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?</p>
  
  <pre><code>SELECT DISTINCT a.id
    FROM table1 a, table2 b
   WHERE a.id = b.id
         AND a.ind IS NULL
         AND b.year &gt;= '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 &gt;= c.start
  </code></pre>
  
  <p>Thanks in advance for any guidance or help.</p>