Question: I'm having trouble sorting my database alphabetically. I assume I need to sort the database here:

```
public static Cursor getAllRecords() {
    return db.query(DATABASE_TABLE, new String[] { KEY_ROWID, KEY_ITEM},
            null, null, null, null, null, null);
}

```

I've tried replacing the last `null` with " DESC" which didn't work.  

Am I doing this in the wrong spot?

Answer: 
Use something like `KEY_ITEM + " DESC"` for the `orderBy` parameter:

```
public static Cursor getAllRecords() {
    return db.query(DATABASE_TABLE, new String[] { KEY_ROWID, KEY_ITEM},
            null, null, null, null, KEY_ITEM + " DESC");  // note the missing last null for 'limit'
}

```
Try this -

```
return db.query(DATABASE_TABLE, new String[] { KEY_ROWID, KEY_ITEM}, null, null, null, null, KEY_ITEM+ " ASC");

```

or

```
return db.query(DATABASE_TABLE, new String[] { KEY_ROWID, KEY_ITEM}, null, null, null, null, KEY_ITEM+ " DESC");

```