Reputation: 309
Caused by: android.database.sqlite.SQLiteException: near "FROM": syntax error (code 1): , while compiling: SELECT _id, FROM TRACKS WERE _id=9
String test = "SELECT _id, FROM TRACKS WERE _id="+"9";
Cursor cursor = database.rawQuery(test, null);
Did not see the Point :( any help
Maybe there is a error in my Statement but it didn't work
Upvotes: 0
Views: 266
Reputation: 69318
No comma after id
and WERE
should be WHERE
.
Also consider using [rawQuery()](http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#rawQuery(java.lang.String, java.lang.String[], android.os.CancellationSignal)] with selectionArgs
to avoid having to concatenate query and values as you did in +id=+9
.
Upvotes: 2