android - SQLite Query in non case sensitive alphabetical order -
this question has answer here:
all want grab stuff in alphabetical order , ignore capital letters.
db.rawquery("select " + catname + " "+tablename+" order "+catname+" asc collate nocase;", null);
this code i'm using above, gives me sqlite exception saying collate syntax error.
android.database.sqlite.sqliteexception: near "collate": syntax error: , while compiling: select artist testtable collate nocase asc
collate
goes before order direction:
db.rawquery("select " + catname + " " +tablename +" order "+catname+" collate nocase asc;", null);
but don't need asc
-- that's default use:
db.rawquery("select "+ catname +" "+ tablename +" order "+ catname +" collate nocase;", null);
Comments
Post a Comment