Hi i'm will be wanna get rows than contains one of arguments of my string. I have string as: "One,Two,Three,". I wanna get cursor with all data from table, that have element from this string ( For example, my find String is my string "rock,is,dead" and i wanna get rows that field contains: "rock". Please help me, thanks
Asked
Active
Viewed 503 times
1 Answers
2
SELECT * FROM Your_Table WHERE 'rock,is,dead' LIKE '%' || String_Column || '%'
For more efficient lookups, you need to split up your search string so that the words can be checked individually, which allows the database to use index lookups (if you have an index):
SELECT * FROM Your_Table WHERE String_Column IN ('rock', 'is', 'dead')
(Please note that plain comparisons, unlike LIKE
, are case sensitive, unless you use a different collation.)

CL.
- 173,858
- 17
- 217
- 259
-
how i can write your query in this way? db.query(DBHelper.TAG_TABLE, null,null,null,null,null,null);??? Thanks – a.black13 Aug 12 '13 at 14:31