title: Use a calculated field in the where clause
body: <p>Is there a way to use a calculated field in the <code>where</code> clause?</p>
  
  <p>I want to do something like</p>
  
  <pre><code>SELECT a, b, a+b as TOTAL FROM (
     select 7 as a, 8 as b FROM DUAL
     UNION ALL
     select 8 as a, 8 as b FROM DUAL
     UNION ALL
     select 0 as a, 0 as b FROM DUAL
  )
  WHERE TOTAL &lt;&gt; 0
  ;
  </code></pre>
  
  <p>but I get <code>ORA-00904: "TOTAL": invalid identifier</code>.</p>
  
  <p>So I have to use</p>
  
  <pre><code>SELECT a, b, a+b as TOTAL FROM (
     select 7 as a, 8 as b FROM DUAL
     UNION ALL
     select 8 as a, 8 as b FROM DUAL
     UNION ALL
     select 0 as a, 0 as b FROM DUAL
  )
  WHERE a+b &lt;&gt; 0
  ;
  </code></pre>