本帖最后由 luoqu 于 2023-11-21 09:44 编辑
两短SQL用union all拼接起来之后就报这个错, 请问这是什么原因?
select
area_name
,area_name as area
,dealer_shortname
,dealer_code
,part_dt
,sum(到店试驾率) as 到店试驾率
,sum(订单匹配度) as 订单匹配度
,sum(客流量) as 客流量
,sum(客流下订率) as 客流下订率
,sum(库存度) as 库存度
,sum(库存匹配度) as 库存匹配度
,sum(批发达成率) as 批发达成率
,sum(剩余订单量) as 剩余订单量
,sum(网销客流量) as 网销客流量
,sum(网销客流下订率) as 网销客流下订率
,sum(线索量) as 线索量
,sum(新增订单) as 新增订单
,sum(有效线索到店率) as 有效线索到店率
,sum(终端达成量) as 终端达成量
from elook.v_e_look_dealer_warming_sc
group by area_name
,dealer_shortname
,dealer_code
,part_dt
union all
select
'全国' as area_name
,'all' as area
,dealer_shortname
,dealer_code
,part_dt
,sum(到店试驾率) as 到店试驾率
,sum(订单匹配度) as 订单匹配度
,sum(客流量) as 客流量
,sum(客流下订率) as 客流下订率
,sum(库存度) as 库存度
,sum(库存匹配度) as 库存匹配度
,sum(批发达成率) as 批发达成率
,sum(剩余订单量) as 剩余订单量
,sum(网销客流量) as 网销客流量
,sum(网销客流下订率) as 网销客流下订率
,sum(线索量) as 线索量
,sum(新增订单) as 新增订单
,sum(有效线索到店率) as 有效线索到店率
,sum(终端达成量) as 终端达成量
from elook.v_e_look_dealer_warming_sc
group by dealer_shortname
,dealer_code
,part_dt
|