title: SQLite - update table to number rows sequentially
body: <p>I have table like this:</p>
  
  <pre><code>CREATE TABLE Scan
  (Id Integer,
  Ordinal Integer)
  
  INSERT Scan VALUES(10, 1)
  INSERT Scan VALUES(20, 1)
  INSERT Scan VALUES(30, 8)
  INSERT Scan VALUES(40, 10)
  </code></pre>
  
  <p>I'd like to update Ordinal column so all the numbers become sequential like so(in case of duplicate Ordinal order by Id):</p>
  
  <pre><code>Id Ordinal
  10 1
  20 2
  30 3
  40 4
  </code></pre>
  
  <p>Is it possible with plain SQL in SQLite?</p>