title: Why do I get the error "Incorrect syntax near 'RESULT'" but renaming the CTE works fine?
body: <p>I found this query for returning nth highest salary in sql server.</p>
  
  <pre><code>WITH RESULT
       AS (SELECT salary,
                  DENSE_RANK() OVER (ORDER BY salary DESC) AS DENSERANK
           FROM   Employees)
  SELECT salary
  FROM   RESULT
  WHERE  RESULT.DENSERANK = 2 
  </code></pre>
  
  <p>When I changed RESULT to RESULTS it is working, but RESULT is not working... WHY?</p>
  
  <p>I am using SQL SERVER 2012</p>