title: Multiplying two columns which have been calculated on a CASE statement
body: <p>I am performing a SQL query in PostgreSQL using a <code>CASE</code> statement like this:</p>
  
  <pre><code>SELECT
      CASE column1
          WHEN something THEN 10
          ELSE 20
          END AS newcol1
      CASE column12
          WHEN something THEN 30
          ELSE 40
          END AS newcol2
  COUNT(column3) newcol3
  FROM table
  GROUP BY newcol1,newcol2,newcol3
  </code></pre>
  
  <p>I need a fourth column which has to be the result of <code>newcol2 * newcol3</code>, how can I do that?</p>
  
  <p>If I put <code>(newcol2 * newcol3) AS newcol4</code> I get a syntax error.</p>