title: Alias the long repeated expression in postgresql query
body: <p>Is there any way in postgresql to not repeat myself when the same expression is used in select and where blocks?</p>
  
  <pre><code>select (
      |/(( power((consumption_2011 - consumption_3y/3), 2)
         + power((consumption_2012 - consumption_3y/3), 2)
         + power((consumption_2013 - consumption_3y/3), 2)
      ) / 3)) as deviation
  from consumption
  where (
      |/(( power((consumption_2011 - consumption_3y/3), 2)
         + power((consumption_2012 - consumption_3y/3), 2)
         + power((consumption_2013 - consumption_3y/3), 2)
      ) / 3) &gt; 0.8
  )
  </code></pre>