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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With