Sql where condition with case is not converting to bool query

Hello @elastic

I have a view called V1, I want to filter data based on role. If role is 1 or 2 then role can see all record else for other role they can see only those record which is assign to them.
sql query:

select * from V1 
where case when role in (1,2) 
then 1=1 
else role = ${role}

I want to convert above sql query to bool query.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.