Toad World® Forums

Queries with an underscore

WHERE (QO_Classification_DE.EntryCode LIKE ‘%_o’).
when the query runs, it also pulls in entries that just end in “o” instead of ones that end in “_o”.

I have a query that the search criteria is

In LIKE expressions the ‘_’ character is the single character wildcard. Same as the ‘?’ character in file name GLOB style wildcards or ‘.’ in regular expressions.

So basically writing LIKE ‘%_o’ in SQL means a string that is at least 2 characters long and ends with the character ‘o’.