title: Get offset of a row after performing sort operation in sql
body: <p>I am using SQLite database.</p>
  
  <p>Suppose I have rows with IDs 1 to 50. Then I perform <code>select</code> and <code>order by</code> operation.</p>
  
  <p>Say, the result is IDs : 6,3,5,2,9,12,1,34,45,15.</p>
  
  <p>Now, I want to know the offset of a particular row with given ID in the above result.e.g. offset of <code>ID 1</code> is 6.</p>
  
  <p>Can I do this in a single query?</p>