I have the following SQL statement that joins 2 tables X and Y and applies 
LIKE clause as below on the "PARENT_PATH" column of the Y table. However, 
the problem is that values of the "PARENT_PATH" column of the Y table can 
potentially have special characters like % within it. So I tried using 
square brackets around the Y.PARENT_PATH column as below:



*SELECT DISTINCT X.IDFROM X,  YWHERE X.col1 = Y.col2 AND "/a/b/c" LIKE 
[Y.PARENT_PATH]%*

However, I got the following error from H2 database:




*org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "SELECT 
DISTINCT X.IDFROM X,  YWHERE X.col1 = Y.col2 AND "/a/b/c" LIKE 
[[*]Y.PARENT_PATH]%*
Any ideas on how to solve this problem? Please note that the column 
Y.PARENT_PATH is on the right side of the LIKE clause, and can have special 
characters such as % within it. What is the best way to solve this problem 
with SQL?

Thanks a lot for the help in advance!

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to