title: SQLite select all tables DESC
body: <p>I have found the solution to get all tables in SQLite here.
  <a href="https://stackoverflow.com/questions/82875/how-do-i-list-the-tables-in-a-sqlite-database-file">How to list the tables in an SQLite database file that was opened with ATTACH?</a>
  However, when I change: </p>
  
  <pre><code>SELECT name FROM sqlite_master WHERE type='table';
  </code></pre>
  
  <p>into: </p>
  
  <pre><code>SELECT name FROM sqlite_master WHERE type='table' ORDER BY name DESC;
  </code></pre>
  
  <p>the output is completely weird.
  The first query gives me: 
  tbl201306 --> only 1 table so far, for June 2013.
  The second query gives me: 
  android_metadata --> the name is not changed, but it returns this name.</p>
  
  <p>I want to have these tables in descending order because in the future, the newest table would be on the top then.</p>
  
  <p>My complete code: </p>
  
  <pre><code>public ArrayList&lt;String&gt; getDBTables() {
      ArrayList&lt;String&gt; toReturn = new ArrayList&lt;String&gt;();
      try {
          Cursor c = db.rawQuery("SELECT name FROM sqlite_master WHERE type='table' ORDER BY name DESC", null);
          c.moveToFirst();
  
          while (c.moveToNext()) {
              toReturn.add(c.getString(c.getColumnIndex("name")));
          }
          c.close();
      }
      catch(SQLiteException e) {
          e.printStackTrace();
      }
      return toReturn;
  }
  </code></pre>