How to use case

I have to report on our programs and the worker roles that are in use for that program.
select pi.program_name, wr.worker_role_id from worker_role_program_link_view wr
inner join program_info pi
on wr.program_info_id = pi.program_info_id
case when worker_role_id = '06C31A9-A068-4FFD-WWF2-FAF460BD98D3' then ' Service Provider'
I cannot do this fully in SQL because there are programs that share the same worker role id but I don't mind doing it using case if i have to as above.
However this case does not compile.

1 Like