0

Netezza is able to find records when using the LIKE operator when the first character contains a backslash character. But when subsequent characters contain a backslash character, it cannot. How can I correct this?

Result set has records:

SELECT * FROM TABLENAME WHERE PATH LIKE '\some_path%'

Result set has 0 records:

SELECT * FROM TABLENAME WHERE PATH LIKE '\some_path\%'

0

I had to avoid the escape character in the pattern matching string (after the LIKE), and append ESCAPE '' to avoid using the backslash as an escape character. In this example, I had _ characters in the literals, as well as \ characters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.