Trying to make a query that returns a match if this column contains text inside. For example, if I passed the word “really,” a column containing the text “This is a really long line of text” would match. So far, my queries are returned only if they match, so it will match the column containing "really", and that’s all.
I tried a couple of ways, but both seem to return the same result:
The first way (s is the string I'm passing):
Cursor cursor = mDb.query(DATABASE_TABLE, new String[] {KEY_TITLE}, KEY_TITLE + " LIKE '%" + s + "%' COLLATE NOCASE", null, null, null, null);
Next way
String p_query = "SELECT COUNT(*) FROM data WHERE number=? COLLATE NOCASE";
java android sqlite
Paul
source share