开发者

How can I use Like query in SQLite android

开发者 https://www.devze.com 2023-02-17 15:21 出处:网络
Can anyone tell me how to use LIKE command in android SQL开发者_运维问答ite?. Example I have a table with 3 columns Name, Email and Position and I want to get yahoo Email addresses in Email column.

Can anyone tell me how to use LIKE command in android SQL开发者_运维问答ite?. Example I have a table with 3 columns Name, Email and Position and I want to get yahoo Email addresses in Email column. Thanks


Use the enormously long method:

SQLiteQueryBuilder.buildQueryString(boolean distinct, String tables, String[] columns, String where, String groupBy, String having, String orderBy, String limit)

And in the String where set it to a string similar to "column_name LIKE pattern" Note that you don't (and can't) include the word "where" in this string because it is going to be built into it.

http://developer.android.com/reference/android/database/sqlite/SQLiteQueryBuilder.html

0

精彩评论

暂无评论...
验证码 换一张
取 消