title: Calculating row number without ROW_NUMBER function. How does it work?
body: <p>I just came across a way to get row numbers without <code>ROW_NUMBER</code> function:</p>
  
  <pre><code>SELECT name, sal, (SELECT COUNT(*)  FROM EMPLOYEE i WHERE o.name &gt;= i.name) row_num
  FROM EMPLOYEE o
  order by row_num
  </code></pre>
  
  <p>There is some explanation <a href="http://dwbi.org/database/sql/72-top-20-sql-interview-questions-with-answers" rel="nofollow">HERE</a> 
  But I am still not clear on this.</p>