1

please tell me what is wrong in this query:

getting following exception:

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

8
  • will be easy if some code is provided to crawl Commented Sep 30, 2014 at 6:09
  • he can not resolve the "%". What you want with this? Commented Sep 30, 2014 at 6:10
  • Post your sql building statement. Commented Sep 30, 2014 at 6:10
  • do like this '%apk' Commented Sep 30, 2014 at 6:12
  • 1
    try this : select _data, _size, media_type from files where ( _size > '1048576' and media_type = '0' and _data like '%apk') Commented Sep 30, 2014 at 6:15

3 Answers 3

3

try this:

SELECT _data, _size, media_type FROM files WHERE ( _size > 1048576 AND media_type = 0 AND _data LIKE '%apk')
Sign up to request clarification or add additional context in comments.

Comments

0

Try this way,hope this will help you ti solve your problem.

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

Comments

0

I think you have missed the quote after like operator see this

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.