34,576
社区成员
发帖
与我相关
我的任务
分享
select a,case when d is null then b else d end,case when d is null then c else e end,f,g,h from orders
select
[col1]=a,
[col2]=case when d is not null then d else b end,
[col3]=case when d is not null then e else c end,
[col4]=f,
[col5]=g,
[col6]=h
from
t
SELECT a,CASE d IS NULL THEN b ELSE d END AS Column1,
CASE d IS NULL THEN c ELSE e END AS Column2,
f,g,h
FROM ORDERS