title: Need to simplify multiple Select queries
body: <p>This is the structure of my existing SQL query :</p>
  
  <pre><code>SELECT * FROM (
  
      SELECT *, 'A' AS Status FROM Table1
      WHERE Field1 NOT IN 
      (
      SELECT Field1 FROM Table2 WHERE Field 1 = 'val' AND ...
      )
  
      UNION
  
      SELECT *, 'B' AS Status FROM Table1
      WHERE Field1 IN 
      (
      SELECT Field1 FROM Table2 WHERE Field 1 = 'val' AND ...
      )
  
  ) AS Result
  </code></pre>
  
  <p>Here I'm selecting two sets of data from a table and assigning <strong>two different values</strong> (A &amp; B) for the <code>Status</code> column and Union both sets in to one as Result. </p>
  
  <p>Problem with this method is, it needs to duplicate the inner select query <code>SELECT Field1 FROM Table2 WHERE Field 1 = 'val' AND ...</code> (my original sql query is bit complex than the shown above)</p>
  
  <p>How can I rewrite this as a single Select query? Is it possible or not?</p>