title: How to select the rows in an SQL database from a certain point to the end (in android)?
body: <p>I have created a delete function and would like for the serial number (srno) of each row after the deleted one to be decremented by 1 so that continuity without gaps is maintained. Is there any way of doing this?</p>
  <p>public void deleteContact(Contact contact) {</p>
  <pre><code>    SQLiteDatabase db = this.getWritableDatabase();
      int next = contact.getSrno() + 1;
  
      db.delete(Util.TABLE_NAME, Util.KEY_SRNO + &quot;=?&quot;, new String[]{String.valueOf(contact.getSrno())});
  
      //updateList();
      
      db.close();
  }
  </code></pre>
  <p>I can use the loop:</p>
  <p>for(Contact contact : allContacts){}</p>
  <p>But this includes unwanted items. I just wanted to know if there is a method to retrieve the key value (srno) of the last item in the list.</p>