2024-05-06 06:43:12
运行后没有cc那列,只有no和aa
select no
,sum(case when index = 1 then value else 0 end)/count(distinct calcdate) as aa
from A
group by no
union all
select no
,sum(case when index = 5 then value else 0 end)/count(distinct calcdate) as aa
from C
group by no
这样看下数据对不对,上下查询的结果都放同一个字段里面
不行的
我后面这个代码运行完是怎么样的,截图看下