Concerning the "bitmap" on the EMP table, I'm not sure a hierarchical query is the most efficient solution. An alternative:
select j.job,
listagg(decode(j.job, e.job, 1, 0)) within group(order by e.rowid) bitmap
from emp e,
(select distinct job from emp) j
group by j.job;
JOB BITMAP
ANALYST 00000001000010
CLERK 10000000001101
MANAGER 00010110000000
PRESIDENT 00000000100000
SALESMAN 01101000010000
As far as the original question is concerned, maybe the OP wants help with decode?
with data(compass_point) as (
select 'N' from dual
union all
select 'E' from dual
union all
select 'S' from dual
union all
select 'W' from dual
)
select decode(compass_point,'N',1,0) N,
decode(compass_point,'E',1,0) E,
decode(compass_point,'S',1,0) S,
decode(compass_point,'W',1,0) W
from data;
N E S W
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
Best regards,
Stew