34,576
社区成员
发帖
与我相关
我的任务
分享
SELECT
CASE x WHEN xx THEN xxx WHEN xxxx THEN blabla ELSE blablabla END AS columnA,
CASE y WHEN yy THEM columnA+m WHEN yyy THEN columnA+n ELSE THEN columnA+** END
with t1 as
(select columnA=...
from [表名]
),
t2 as
(select columnA,
columnB=case when columnA....
from t1
)
select * from t2
select *,CASE y WHEN yy THEM columnA+m WHEN yyy THEN columnA+n ELSE THEN columnA+** end as columnB from
(
SELECTCASE x WHEN xx THEN xxx WHEN xxxx THEN blabla ELSE blablabla END AS columnA)
) as table1