title: What is the "with [alias] as" in sql?
body: <p>So I came across the following at work, and I can tell right away what it's <strong>for</strong> but I want to find any documentation for it and can't find anything online!</p>
  
  <pre><code>with details as
  (
      select *,
      row_number() over (order by CREATED_DATE) as [Row]
      from
      (
          select top 10 * from MyTable
      ) t
  )
  select *
  from details
  where [Row] &gt; @lowLimit and [Row] &lt; @highLimit
  </code></pre>
  
  <p>This looks to me like its for paging functionality. However, I don't know exactly what structure I'm looking at within the sql syntax. Does anyone recognize this syntax and can you point me to where I can read more about it?</p>
  
  <p>Thanks!</p>