How can I use Like query in SQLite android
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
精彩评论