When running the following query on Android
select *
from EICRChecklistItems
where (Sect, S_Sect, SS_Sect) in (
select Sect, S_Sect, SS_Sect
from EICRCheckList
where Version=2018
order by id
)
order by id
I get the exception:
android.database.sqlite.SQLiteException: near ",": syntax error (code 1)
Columns Sect, S_Sect and SS_Sect are all defined as integer.
But when running on DB Browser against a copy of the same database it executes correctly
Any pointers as to what may be causing this would be greatly appreciated.
private var EICR_CHECK_ITEMS_TABLE = "EICRChecklistItems"
private var EICR_CHECKLIST_TABLE = "EICRCheckList"
val cursor1: Cursor = writableDatabase.rawQuery(
"select * from $EICR_CHECK_ITEMS_TABLE where (Sect, S_Sect, SS_Sect) in (select Sect, S_Sect, SS_Sect from $EICR_CHECKLIST_TABLE where Version='2018' order by id) order by id", null)