select
c.col as Task,
case c.col
when 'Housing' then Housing
when 'Furniture' then Furniture
when 'YardWork' then YardWork
end as Time
from mytable t
cross join
(
select 'Housing' as col
union all select 'Furniture'
union all select 'YardWork'
) c
此处仅列出一列:
select
c.col as Task,
case c.col
when 'Housing' then Housing
end as Time
from mytable t
cross join
(
select 'Housing' as col
) c
1条答案
按热度按时间w7t8yxp51#
可以使用
CROSS JOIN
执行此操作,如下所示:此处仅列出一列:
Demo here