title: How do I multiply two columns and then reuse that value without doing the forumla over and over
body: <p>I am trying to multiply two columns and then use that value to do a CASE statement, I'm not really sure how to ask this or if it's even possible so please bare with me.</p>
  <pre><code>        SELECT (table1.price)*(table2.quantity) AS &quot;total price&quot;, CASE WHEN (table1.price)*(table2.quantity) &lt; 10 THEN 3 CASE WHEN (table1.price)*(table2.quantity) &gt; 10 THEN (CASE WHEN (table1.price)*(table2.quantity) &lt; 20 THEN 2 ELSE 0 END) ELSE 0 END
          FROM table1 JOIN table2 ON table1.id = table2.itemid 
          WHERE table1.id = 41212;
  </code></pre>
  <p>Is there a way to make the table1.price*table2.quantity a function of could I make it an alias and reuse that Alias? I have to later use it in the WHERE statement too.</p>