title: SQL Offset based on ID
body: <p>Trying to find 3 rows based on a users ID.</p>
  
  <p>The results should be offset with the current user and the row before and after:</p>
  
  <pre><code>87. John Snow 1000p
  88. YOU 990p
  89. Jane Doe 900p
  </code></pre>
  
  <p>I have the user variable stored in <code>@currentUser</code> and using the below query which fetches all the relevant actions:</p>
  
  <pre><code>SELECT u.UserID, 
         u.ContentID,  
         (u.FirstName + ' ' + u.LastName) AS theUser, 
         SUM( l.Action ) as thePoints 
  FROM   [AccessLog] l 
         LEFT JOIN [User] u 
             ON l.UserID = u.UserID 
  WHERE  l.Action = 13 
         OR l.Action = 2 
         AND l.Timestamp BETWEEN CONVERT(datetime, '2014-09-01') AND CONVERT(datetime, '2014-09-11') 
  GROUP BY u.UserID, 
         u.ContentID, 
         u.FirstName, 
         u.LastName 
  ORDER BY thePoints DESC
  </code></pre>
  
  <p>How would I go about listing eg. #87 to #89 if my place is #88 ?</p>