SQL数据集出错,请各位大神帮忙看看问题错在哪里

SQL数据集查询报错,提示“错误代码:1301 数据集配置错误 Query: 找不到列 "t" 或”用户定义的函数或聚合 "t.sum",或者名称不明确。


数据集语句如下:

select t.ssbm as 部门

,t.sjld as 上级领导

,t.ywry as 业务人员

,t.sum(jsjr) as 净收入贡献

,t.sum(gdcb) as 固定成本

,t.sum(sfjl) as 实发奖励

,t.sum(ftcb) as 运营分摊

from(

select a.ssbm as ssbm

,a.sjld as sjld

,a.ywry as ywry

,a.yjsrgx as jsjr

,b.xsgz as gdcb

,c.sqje as sfjl

,d.total as ftcb 

from uf_xsjlsjwh a

left join(select xsname,sum(xsgz)as xsgz from uf_xsyjzb 

where ksdate>='${ksrq}' and ksdate<='${jsrq}' group by xsname)b on b.xsname=a.ywry

left join(select sqr,sum(sqje)as sqje from uf_xsydfy

where sqrq>='${ksrq}' and sqrq<='${jsrq}' group by sqr)c on c.sqr=a.ywry

left join(select cwgsbm,sum(total)as total from uf_cwbbdata

where cwgsdate>='${ksrq}' and cwgsdate<='${jsrq}' group by cwgsbm)d on d.cwgsbm=a.ssbm

where a.ssyfnq>='${ksrq}' and a.ssyfnq<='${jsrq}'

)t

group by t.ssbm,t.sjld,t.ywry


baibian 发布于 2020-5-28 16:20
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共4回答
最佳回答
1
豆豆小可爱Lv5中级互助
发布于2020-5-28 16:22

sum(t.jsjr)

t写在sum里面

  • baibian baibian(提问者) 大家都答对了,只能按照时间顺序采纳答案了,哈哈!
    2020-05-29 15:32 
最佳回答
1
ScyalcireLv7中级互助
发布于2020-5-28 16:22(编辑于 2020-5-28 16:24)

image.png表名字在sum括号里面

最佳回答
1
547417937Lv4初级互助
发布于2020-5-28 16:24(编辑于 2020-5-28 16:33)

select t.ssbm as 部门

,t.sjld as 上级领导

,t.ywry as 业务人员

,sum(t.jsjr) as 净收入贡献

,sum(t.gdcb) as 固定成本

,sum(t.sfjl) as 实发奖励

,sum(t.ftcb) as 运营分摊

from(

select a.ssbm as ssbm

,a.sjld as sjld

,a.ywry as ywry

,a.yjsrgx as jsjr

,b.xsgz as gdcb

,c.sqje as sfjl

,d.total as ftcb 

from uf_xsjlsjwh a

left join(select xsname,sum(xsgz) as xsgz from uf_xsyjzb 

where ksdate>='${ksrq}' and ksdate<='${jsrq}' group by xsname) b on b.xsname=a.ywry

left join(select sqr,sum(sqje) as sqje from uf_xsydfy

where sqrq>='${ksrq}' and sqrq<='${jsrq}' group by sqr) c on c.sqr=a.ywry

left join(select cwgsbm,sum(total)as total from uf_cwbbdata

where cwgsdate>='${ksrq}' and cwgsdate<='${jsrq}' group by cwgsbm) d on d.cwgsbm=a.ssbm

where a.ssyfnq>='${ksrq}' and a.ssyfnq<='${jsrq}'

) t

group by t.ssbm,t.sjld,t.ywry


最佳回答
0
lricLv6初级互助
发布于2020-5-28 16:23

image.png

  • 5关注人数
  • 418浏览人数
  • 最后回答于:2020-5-28 16:33
    请选择关闭问题的原因
    确定 取消
    返回顶部