mercredi 25 février 2015

android.database.sqlite.SQLiteException: near "-- " syntax error code 1

When i rum following query on my database it give me android.database.sqlite.SQLiteException: near "--,COUNT(*) FROM .. with syntax error code 1 .



SQLiteDatabase db = getReadableDatabase();
final String MY_QUERY="SELECT distinct d.* FROM deseases d where d.deseaseID in (select s.deseaseID --,COUNT(*) FROM (select distinct deseaseID, syntomDescription FROM syntoms ) S where s.syntomDescription in ("+symptoms+") group by s.deseaseID having COUNT(*)="+symptomCount+") and d.deseaseID in (select m.deseaseID FROM (select distinct deseaseID, morphologyName FROM morphology ) m where m.morphologyName in ("+morphology+") group by m.deseaseID having COUNT(*)="+morphologyCount+" ) and d.chapterID = "+category;

Cursor c = db.rawQuery(MY_QUERY, null);


Please tell me what i am doing wrong.


Aucun commentaire:

Enregistrer un commentaire