title: How to get row number in SQLite?
body: <p>I've read many articles regarding how to use a row number in SQLite but none of them gave me the answer I need. I know how to select row number using this query:</p>
  
  <pre><code>SELECT (SELECT COUNT() FROM table WHERE title &lt; t.title OR (title = t.title AND id&lt;t.id)) as rowIndex, t.title FROM table AS t ORDER BY t.title;
  </code></pre>
  
  <p>but if I add <code>COLLATE NOCASE</code> (which I need) at the end of the query then the result is completely different.</p>