Android sqlite字符串参数值不起作用。例如,
SELECT t0.id FROM Employer t0
WHERE (select count(t1.id) from Employee t1 where t1.employerId=t0.id) > ?
参数(?)值是一个数字。 Android sqlite需要参数值 串。
rawQuery(sql, String[] arguments)
来自sqlite3控制台:
如果将参数值作为字符串传递给" 1",则查询将始终返回空集。
SELECT t0.id FROM Employer t0
WHERE (select count(t1.id) from Employee t1 where t1.employerId=t0.id) > '1'
如果是1:
之类的数字SELECT t0.id FROM Employer t0
WHERE (select count(t1.id) from Employee t1 where t1.employerId=t0.id) > 1
作品。
如何将数字作为上述示例的参数值传递?