ILIKE, LIKE, etc giving me errors that I cannot seem to resolve

I am attempting to use ILIKE with wildcard matching. I have simplified the query to the following for troubleshooting purposes:

select * from table1 where column1 LIKE {{'%' + textinput6.value + '%' }};

I have tried the above with and without the wildcard matching. I have also tried ILIKE as well as LIKE (db is mysql). However, I keep getting the following error:

ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1

For anyone experiencing similar problems, I solve the issue by writing the query as follows:

select * from table1 where column1 LIKE ('%{{ textinput6.value }}%');

nevermind. When I add the above statement to an and clause in a query that has multiple conditions, it fails again; giving me the same syntax error.

wait, it does work typo on my part. I left the semilcolon at the end.sorry

1 Like

Thanks for sharing! Yea, the LIKE and ILIKE can vary a lot across SQL dialects. Don’t even get me started about BigQuery…