I have a table which I want to filter by two columns: company_id and investor_id
select * from {{formatDataAsArray(read_investments.data)}} investments
where investments.company_id=ANY({{multiselect1.value}})
AND case when {{select23.value > 0}} then investments.investor_id={{select23.value}} else true
I've written this query which attempts to filter by company_id and then by investor_id, if select23 > 0. If the value is 0, then I want it to return all investor ids (essentially ignoring this filter).
I am getting a parse error, have i written my code incorrectly?
Filtering by company alone works fine, i know the problem does not lie there.