Reputation: 561
I am gettingandroid.database.sqlite.SQLiteException: near "where": syntax error (code 1):
exception in the below code..Where i am going wrong?
String selectQuery = "SELECT * FROM " + TABLE_VIDEO + " order by " + KEY_TIMESTAMP + " ASC "+"where " + KEY_TYPE + "='trending'";
Upvotes: 1
Views: 1289
Reputation: 38098
ORDER BY
must be the last SQL clause in your query.
So, it must come after the WHERE condition.
Upvotes: 4
Reputation: 2340
may be the:
/*code*/+ " ASC "+"where "+ /*morecode*/
try:
/*code*/+ " ASC WHERE "+ /*morecode*/
Upvotes: -1