Is it possible to use a comma separated string for an IN
query?
I would like to execute the following query using the string a,b,c
select * from tablename where colname in ('a', 'b', 'c')
Example - select * from tablename where colname in (split_string('a,b,c'))
You can use split(string,delimiter)
for splitting string and boolean function contains(array, element)
to check if array contains value:
select * from tablename where contains(split('a,b,c',','),colname)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With