Reputation: 2761
Is it possible to use dollar-quoted strings within a SELECT ... LIKE?
i.e.
SELECT "firstName", "lastName" FROM person WHERE "firstName" LIKE '%$xx$j$xx$'
or
SELECT * FROM person WHERE "firstName" LIKE $xx$j$xx$
or
SELECT * FROM person WHERE "firstName" LIKE $xx$j$xx$%;
The first returns no rows, because I have no names that start with $xx$j$xx$. The second returns no rows. The third returns a syntax error at the semicolon (due to the hanging %)
Upvotes: 0
Views: 175
Reputation:
The LIKE wildcard needs to be part of the string, not after the string:
SELECT * FROM person WHERE "firstName" LIKE $xx$j%$xx$;
or simpler
SELECT * FROM person WHERE "firstName" LIKE 'j%';
Upvotes: 1