我希望通过在内部查询中选择数据来修改数据 并计算其中之一已修改.. 它给出了错误..
select count(cvs) from
(
select
cvs,
(case Citycode when 123 then 'test' else 'other' end) as CityName ,
(case ProductCode when '000' then 'test3' when 'ss' then 'xtr' else 'ddd' end) as CardName
from Applications
)
最佳答案
您需要为子查询指定别名:
select count(x.cvs) from
(
select
cvs,
(case Citycode when 123 then 'test' else 'other' end) as CityName ,
(case ProductCode when '000' then 'test3' when 'ss' then 'xtr' else 'ddd' end) as CardName
from Applications
) x
关于sql - 从嵌套选择 T-SQL 中选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6988220/