Select from MySQL table with "IN" statement

Hi all!
Can anyone tell me how I can filter a result in table with a multiply values specified by users
eg select * from users where id in (1,2,3,4,5...) where 1,2,3,4,5 specified by users
i cannot use text input because it return string value http://joxi.ru/L214zKgTRe3Egm
and i cannot use query builder because it generate a syntax error http://joxi.ru/RmzNx0jiYp38lm
p.s. i didnt find a docs about query bulider

Hey @nikita-kuzmin ah yes handling arrays can be tricky … we actually have some docs for that! https://retool.com/docs/sql-query-faq#section-my-sql

So I would suggest something like this for MySQL:

select * from table_name where {{!textinput1.value}} OR column_name IN ({{ textinput1.value.split(', ') }})

Some notes: (1) The snippet {{!textinput1.value}} OR ensures that you’ll display all your results when the textinput is empty and (2) the reason we are able to do {{ textinput1.value.split(', ') }} is because anything inside of {{ }} is just JavaScript, so we are turning the string into an array

Hi @david-dworsky !

It helps me, thank you!