sqlite查询android异常

时间:2014-09-30 06:07:13

标签: android sqlite android-sqlite

请告诉我这个查询有什么问题:

获得以下异常:

android.database.sqlite.SQLiteException: near "%": syntax error (code 1):,  在编译时:SELECT _data, _size, media_type FROM files WHERE ( _size > 1048576 AND media_type = 0 AND _data LIKE %apk)

3 个答案:

答案 0 :(得分:3)

试试这个:

SELECT _data, _size, media_type FROM files WHERE ( _size > 1048576 AND media_type = 0 AND _data LIKE '%apk')

答案 1 :(得分:0)

我认为您在喜欢运营商之后错过了报价 see this

答案 2 :(得分:0)

请尝试这种方式,希望这有助于您解决问题。

select _data, _size, media_type from files where ( _size > '1048576' and media_type = '0' and _data like '%apk')