I'm using SQLITE
and I'm trying to find the exact word on a sentence, but I'm not getting just the word I'm getting for instance if I'm looking for Water
I'm getting also aWater
, wateri24
and that's not what I'm looking for.
I've created an example here on sqliteonline
to show you how do I store the sentences, there are in table b.
This is an example of what is happening
NOTE: I'm looking for an answer that uses ignore cases, for instance if I want to find water
I want to get wAtER
and WatER
, and so…
What I'm missing?
Best Answer
You could do something like this:
When considering that a word like water can only be surrounded by spaces, comma's and square brackets.
And you could technically remove some of the wildcards:
SQLliteOnline example #1
SQLliteOnline example #2
Both returning:
Like operator should be case sensitive.
Source
If it wasn't,
COLLATE NOCASE
could be used More on that here