WHERE IN clause in Android sqlite?

前端 未结 7 1677
無奈伤痛
無奈伤痛 2020-12-31 09:18

I can\'t get WHERE IN clause to work on android SQLite database.

Is there any way to execute a statement like this in android? :

SELECT body FROM ta         


        
7条回答
  •  -上瘾入骨i
    2020-12-31 09:33

    If you are using a content provider you can use the query function as such:

    getContentResolver().query(URI,new String[] {"body"}, "title IN ?", new String[] {"('title1','title2','title3')"}, null)
    

    Note that I have not tested this, but according to the documentation, this should work.

提交回复
热议问题