title: Using an alias name multiple times in SQL query?
body: <p>I use the same alias (RankedPrice) twice in my query. I expected that to cause an error. But it worked well. Why does this happen ? I was expecting it throw a variable scope error like C++ or Java, but it does not happen.</p>
  
  <pre><code>select *
  from
  (select *, RANK() over(order by retailprice) as RankedPrice
  from CurrentProducts) as RankedPrice
  where RankedPrice = 5
  </code></pre>