title: Sqlite Scrolling Cursor How to Scroll Correctly with duplicate names
body: <p>I have implemented a scrolling cursor with SQL Lite and C#.
  Well the I am only testing with SQL in an SQL Lite tool.</p>
  
  <p>So I have it functioning the scrolling cursor from:</p>
  
  <p><a href="http://sqlite.org/cvstrac/wiki?p=ScrollingCursor" rel="nofollow">http://sqlite.org/cvstrac/wiki?p=ScrollingCursor</a></p>
  
  <p>So I have this working but the results are not correct.</p>
  
  <pre><code>SELECT title FROM tracks
       WHERE singer='Madonna'
         AND title&gt;:lasttitle
       ORDER BY title
       LIMIT 5;
  </code></pre>
  
  <p>So say these are the fields in my track table:</p>
  
  <p>track_id
  singer
  title
  media_format</p>
  
  <p>and say I have a bunch of records ()</p>
  
  <pre><code>4    Madonna    &lt;All my love demo&gt;    .mp3
  2    Madonna    &lt;Be cool demo&gt;    .wav
  7    Madonna    &lt;Like a Virgin&gt;    .aaf
  1    Madonna    &lt;Like a Virgin&gt;    .adi
  5    Madonna    &lt;Like a Virgin&gt;    .mp4
  11    Madonna    &lt;Like a Virgin&gt;    .wmv
  3    Madonna    &lt;Like a Virgin&gt;    .mp5
  8    Madonna    &lt;Like a Virgin&gt;    .mp6
  10   Madonna    &lt;Like a Virgin&gt;    .mp7
  9    Madonna    &lt;Like a Virgin&gt;    .mp8
  6   Madonna    &lt;Like a Virgin&gt;    .mp9
  </code></pre>
  
  <p>So basically I have unlimited records of the same title as long as the media_format is different, the media_format makes them unique.</p>
  
  <p>The records are ordered by title (as you can see in the query) so the unique id is not in order.</p>
  
  <p>How can I do the scrolling cursor, when scrolling forward to get the next 5 records where the lastitle was </p>
  
  <p><strong>lets say I have already loading the first page into my C# app and I then I scroll forward with  in the lastitle variable</strong></p>
  
  <p>It will not give me the correct records.
  so if I change the greater than > to greater than or equal to >= then it will give me 5 records starting with the first occurrence of  but I need it to start on record 6</p>
  
  <p>I need to see:</p>
  
  <p>page 1</p>
  
  <pre><code>4    Madonna    &lt;All my love demo&gt;    .mp3
  2    Madonna    &lt;Be cool demo&gt;    .wav
  7    Madonna    &lt;Like a Virgin&gt;    .aaf
  1    Madonna    &lt;Like a Virgin&gt;    .adi
  5    Madonna    &lt;Like a Virgin&gt;    .mp4
  </code></pre>
  
  <p>page 2</p>
  
  <pre><code>11    Madonna    &lt;Like a Virgin&gt;    .wmv
  3    Madonna    &lt;Like a Virgin&gt;    .mp5
  8    Madonna    &lt;Like a Virgin&gt;    .mp6
  10   Madonna    &lt;Like a Virgin&gt;    .mp7
  9    Madonna    &lt;Like a Virgin&gt;    .mp8
  </code></pre>