title: Query from 3 different tables
body: <p>In this query below, how do you do a query </p>
  
  <p>where if tbl3.CID exists in tbl1.ID or tbl3.CID exists in tbl2.ID where alert &lt;> '', </p>
  
  <p>then 'CONFIRM' else 'OUT' end Result?</p>
  
  <pre><code>select * from tbl3, tbl4 where tbl3.type = tbl4.name and tgl4.GroupName &lt;&gt; 'abc'
  
  tbl1 
  ID Prime_Number
  1  1-11
  1  1-22
  2  2-11
  
  tbl2
  ID Alert
  1  NULL
  2  NULL
  3  XOM
  
  tbl3
  CID  Sales
  1    100
  3    200
  4    300
  
  tbl4
  Name  GroupName
  CORP  Corporates
  INTL  International
  </code></pre>
  
  <p>Expected result</p>
  
  <pre><code>Result  CID  Sales
  CONFIRM 1    100   --&gt; from tbl1
  CONFIRM 3    200   --&gt; from tbl2
  OUT     4    300
  </code></pre>