I have the following value in a db column:
some%thing
I’m using h2 and postgres, but can’t figure out why this query, where I have escaped the %
to perform a literal search, is not matching the row highlighted?:
LIKE 'some%thing'
Advertisement
Answer
Because 'value'
is a character string literal and not the name of your column. You need to use double quotes instead.
"value" LIKE 'some%hing'