select
(case XX when 'AA' then 1 else 0 end) as AA,
(case XX when 'BB' then 1 else 0 end) as BB,
(case XX when 'CC' then 1 else 0 end) as CC
from 表
(case XX when 'AA' then 1 else 0 end) as AA,
(case XX when 'BB' then 1 else 0 end) as BB,
(case XX when 'CC' then 1 else 0 end) as CC
from 表
select
(case XX when 'AA' then 1 else 0 end) as AA,
(case XX when 'BB' then 1 else 0 end) as BB,
(case XX when 'CC' then 1 else 0 end) as CC
from 表
select
(case XX when 'AA' then 1 else 0 end) as AA,
(case XX when 'BB' then 1 else 0 end) as BB,
(case XX when 'CC' then 1 else 0 end) as CC
from 表