title: How to use rank function in SQL Server
body: <p>I am trying to get records between fifth to tenth. 
  I am using below query in sql server </p>
  
  <p>Plz make me correct </p>
  
  <pre><code>SELECT ID,
         code,
         first name,
         last name,
         RANK() OVER(ORDER BY code) AS rk
  FROM tbl_em_employees
  WHERE rk BETWEEN 5 AND 10;
  </code></pre>
  
  <p>Its giving me error </p>
  
  <blockquote>
    <p>Invalid rk.</p>
  </blockquote>