Like statement is not working in a filter field

I am creating a dashboard where I am pulling my data from Redshift. I am trying to create the query event to filter data in the table based on key words used in this search field. My query is below:

select * from pricing_log where supplier like {{ ‘%’ + name_input.value + ‘%’ }} order by created_at desc

I am getting a syntax error near from order. It looks like the error is located in LIKE condition, but I am not sure about it.

Please let me know your comments

Hey @eiffela65, sorry again for the delay (and welcome to the community!). Can you send a screenshot of the error you’re getting?

It might be related to the LIKE clause itself. The docs say that ILIKE should be used instead. However, I am trying it with ILIKE and having that same issue. So, not sure what I’m telling you will really help.

Hi Justin, I got the query to work by doing the following (I am using a mysql db).

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

1 Like