mercredi 14 janvier 2015

SQLite JOIN Query not functioning

I'm trying to run this SQL Statement below, it will always return an empty cursor. But when I try to run it an SQLite Browser, the query runs just fine.



String sqlSelect = "SELECT * FROM " + TABLE_P + ", " +
TABLE_SP + " WHERE " + TABLE_P + "." + COL_ID +
" = " + TABLE_SP + "." + COL_P_ID + " AND " +
TABLE_SP + "." + COL_SP_ID + " = " + spId;

SQLiteDatabase db = getReadableDatabase();
Cursor cursor = db.rawQuery(sqlSelect, null);


I'm trying to Join two tables.


Aucun commentaire:

Enregistrer un commentaire