title: Accurate pagination by datetime field
body: <p>I have a database table, for example 'items'. I have a timeline of these items, sorted by field ascended_at (datetime). I need to make a pagination api for such timeline. So, the first my version was:</p>
  
  <pre><code>HTTP GET /items/timeline?page=[PAGE_NUM]
  </code></pre>
  
  <p>which fires </p>
  
  <pre><code>SELECT * FROM items LIMIT 10 OFFSET [0, 10, 20, ...] ORDER BY ascended_at;
  </code></pre>
  
  <p>but here is the problem: when new item arrives, all pages shifts per 1 item. To avoid this, i have added from_asc_at parameter:</p>
  
  <pre><code>HTTP GET /items/timeline?page=[PAGE_NUM]&amp;from_asc_at=123123123
  </code></pre>
  
  <p>which fires </p>
  
  <pre><code>SELECT * FROM items WHERE ascended_at &lt;= [asc_at_parameter] LIMIT 10 OFFSET [0, 10, 20, ...] ORDER BY ascended_at;
  </code></pre>
  
  <p>but this is not accurate, because it is possible to have two items with same ascended_at, and you can see the same item in two different pages (but should not).</p>
  
  <p>So, my question is: what are the possible solutions for this? </p>
  
  <ul>
  <li>Use ID (because it is unique)? But what if it is not ordered by ID?</li>
  <li>Any ideas more?</li>
  </ul>