title: Difference between CTE and SubQuery?
body: <p>From this post <a href="https://stackoverflow.com/questions/706720/how-to-use-rownumber-in-the-following-procedure/706756#706756">How to use ROW_NUMBER in the following procedure?</a></p>
  
  <p>There are two versions of answers where one uses a <code>sub-query</code> and the other uses a <code>CTE</code> to solve the same problem.</p>
  
  <p>Now then, what is the advantage of using a <code>CTE (Common Table Expression)</code> over a 'sub-query`(thus, more <strong><em>readable</em></strong> what the query is actually doing)</p>
  
  <p>The only advantage of using a <code>CTE</code> over <code>sub-select</code> is that I can actually <em>name</em> the <code>sub-query</code>.  Are there any other differences between those two <em>when a CTE is used as a simple (non-recursive) CTE?</em></p>