I tried to search a for name that starts with a or b or c, so I used this query:
db.rawQuery("SELECT _id, name, freq FROM dicttable WHERE name LIKE '[A,B,C]%'
ORDER BY freq DESC LIMIT 0, 8", null);
It did not give null result or fail result, it just gave empty values which means it found nothing. Can anyone guide me on this method?
You can't do that sort of thing with LIKE
. You'll need to use GLOB
like so:
...WHERE name GLOB '[ABC]*' ...
The *
means anything else, so this will match any name that starts with A, B, or C and has anything else following it.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.