title: SQL not recognizing column alias in where clause
body: <p>I am only a beginner in SQL, but I've come across this annoying error. SQL is having an issue with the WHERE clause of this script:</p>
  
  <pre><code>SELECT
    ITEM_ID, ITEM_PRICE, DISCOUNT_AMOUNT, QUANTITY, 
    (ITEM_PRICE*QUANTITY) AS price_total, 
    (DISCOUNT_AMOUNT*QUANTITY) AS discount_total, 
    ((ITEM_PRICE-DISCOUNT_AMOUNT)*QUANTITY) AS item_total
  FROM ORDER_ITEMS
  WHERE item_total &gt; 500
  ORDER BY item_total;
  </code></pre>
  
  <p>I am receiving this error:</p>
  
  <pre class="lang-none prettyprint-override"><code>Error starting at line : 1 in command -
  SELECT 
    ITEM_ID, ITEM_PRICE, DISCOUNT_AMOUNT, QUANTITY,  
    (ITEM_PRICE*QUANTITY) AS price_total,  
    (DISCOUNT_AMOUNT*QUANTITY) AS discount_total,  
    ((ITEM_PRICE-DISCOUNT_AMOUNT)*QUANTITY) AS item_total 
  FROM ORDER_ITEMS 
  WHERE item_total &gt; 500 
  ORDER BY item_total DESC;
  Error at Command Line : 7 Column : 7
  Error report -
  SQL Error: ORA-00904: "ITEM_TOTAL": invalid identifier
  00904. 00000 -  "%s: invalid identifier"
  *Cause:    
  *Action:
  </code></pre>
  
  <p>I have no idea why it has no issue with price_total nor discount_total, but is reporting item_total as invalid. I am trying to first select only the items which have a total greater than 500 when the discount amount is subtracted and it is multiplied by the quantity. Then, I need to sort the results in descending order by item_total</p>