android.database.sqlite.SQLiteException: "-- " 附近的语法错误代码 1

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

当我 运行 对我的数据库进行以下查询时,出现以下错误:

android.database.sqlite.SQLiteException: near "--,COUNT(*) FROM .. with 
syntax error code 1 

这是我的查询:

SQLiteDatabase db = getReadableDatabase();
final String MY_QUERY="SELECT 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);

请告诉我哪里做错了。

-- 在 SQL 中开始评论。注释前的 SQL 不构成语法上有效的查询。

不清楚您实际想要实现什么,但删除 -- 可能会使其在语法上有效。

原始查询可能在 COUNT(*) 之后有一个换行符。

删除整个评论,即 --,COUNT(*)