Can someone help me with this request?
I am new to using CASE, how can I do this. If rights = manager, then I want to run the code in this case.
select email, user_id, first_name, last_name, rights
from users u
where company_id = 2141
and receives_emails = 'y'
case u.rights when 'manager' then
and user_id in (select user_id from manager_depts where company_id = u.company_id and dept_id = 2)
end
Thank!
source
share