lundi 11 janvier 2016

How to keep specific row at bottom of order?

I have table ContactsCategoriesTable, which has column name. Names in such column can be anything and 'UNSORTED' in particular. I want to make such an orderby statment, that my querry is first sorted by ContactsCategoriesTable.Name, then by ContactsTable.NAME and UNSORTED rows are always at them bottom of table. i tried following but unsuccessful. How to make such statment?

sortOrder = ContactsCategoriesTable.NAME + " ASC, " + ContactsTable.NAME + " ASC, "
              + ContactsCategoriesTable.NAME + " = 'UNSORTED' ASC ";

Aucun commentaire:

Enregistrer un commentaire