title: How to sort SQLite data by _id AND by another column
body: <p>I have this database for my game results, and I want it to be sorted by descending time, but on the left i don't want to be like in the picture, I want to go from 1 to 20. How to do that? I placed all these data in a TextView in my xml file.</p>
  
  <p><img src="https://i.imgur.com/oYiPZIN.jpg" alt="screenshot"></p>
  
  <p>Here my database class:</p>
  
  <pre><code>public class OffDBHelper {
  
      public static final String KEY_ROWID = "_id";
      public static final String KEY_NAME = "name";
      public static final String KEY_SCORE = "score";
  
      private static final String DATABASE_NAME = "highscores";
      private static final String DATABASE_TABLE = "highscorestable";
      public static final int DATABASE_VERSION = 1;
  
      private DbHelper ourHelper;
      private final Context ourContext;
      private SQLiteDatabase ourDatabase;
  
      private static class DbHelper extends SQLiteOpenHelper{
  
          public DbHelper(Context context) {
              super(context, DATABASE_NAME, null, DATABASE_VERSION);
          }
  
          @Override
          public void onCreate(SQLiteDatabase db) {
              db.execSQL("CREATE TABLE " + DATABASE_TABLE + " (" +
                      KEY_ROWID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + 
                      KEY_NAME + " TEXT NOT NULL, " +
                      KEY_SCORE + " DOUBLE NOT NULL);"
                      );
          }
  
          @Override
          public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
          db.execSQL("DROP TABLE IF EXISTS " + DATABASE_TABLE);
          onCreate(db);       
          }
  
      }
  
      public OffDBHelper(Context c){
          ourContext = c;
      }
  
      public OffDBHelper open() throws Exception{
          ourHelper = new DbHelper(ourContext);
          ourDatabase = ourHelper.getWritableDatabase();
          return this;
      }
      public void close(){
          ourHelper.close();
      }
  
      public long createEntry(String name, double score) {
          ContentValues cv = new ContentValues();
          cv.put(KEY_NAME, name);
          cv.put(KEY_SCORE, score);
          return ourDatabase.insert(DATABASE_TABLE, null, cv);
      }
  
      public String getData() {
          String[] columns = new String[]{KEY_ROWID, KEY_NAME, KEY_SCORE};
          Cursor c = ourDatabase.query(DATABASE_TABLE, columns, null, null, null, null, "score DESC");
          String result = "";
  
          int iRow = c.getColumnIndex(KEY_ROWID);
          int iName = c.getColumnIndex(KEY_NAME);
          int iScore = c.getColumnIndex(KEY_SCORE);
  
          for(c.moveToFirst(); !c.isAfterLast(); c.moveToNext()){
              result = result + c.getString(iRow) + " " + c.getString(iName) + " " + c.getString(iScore) + "\n";
          }
  
          return result;
  
  
      }
  }
  </code></pre>
  
  <p>And my data managing class:</p>
  
  <pre><code>TextView tv = (TextView) findViewById(R.id.tvSQLinfo);
  
          OffDBHelper info = new OffDBHelper(this);
          try {
              info.open();
          } catch (Exception e) {
              e.printStackTrace();
          }
          String data = info.getData();
          info.close();
          tv.setText(data);
  </code></pre>