title: SQL: Use a calculated fields from the SELECT in the WHERE clause
body: <p>I have a SQL query that does some ranking, like this:</p>
  
  <pre><code>SELECT RANK() OVER(PARTITION BY XXX ORDER BY yyy,zzz,oooo) as ranking, * 
  FROM SomeTable
  WHERE ranking = 1 --&gt; this is not possible
  </code></pre>
  
  <p>I want to use that ranking in a WHERE condition at the end.</p>
  
  <p>Now I nest this query in another query and do filtering on the ranking there, but is there no easier or faster way to filter on such values from the SELECT statement?</p>