不是单组分组函数

橙色阳光 2017-02-28 10:35:46


select a.year||'年',(sum(a.shouruz) ) as 门诊收入
from Xt_Mzsrfylb_Yd a
where a.fuwujgbh='330301001' and a.year='2016' and a.month='8' and rownum < 5



哪里错了?
...全文
275 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
LongRui888 2017-02-28
  • 打赏
  • 举报
回复
你是要做分组求和,还是要现实明细同时求和呢? 第一种,就是最后加上 group by A.year 第2种,可以用 a.year||'年',(sum(a.shouruz) over()) as 门诊收入
卖水果的net 2017-02-28
  • 打赏
  • 举报
回复
最后加一句 group by a.year
sych888 2017-02-28
  • 打赏
  • 举报
回复
year的值已经订了,可以直接写 select ‘2016年',(sum(a.shouruz) ) as 门诊收入 from Xt_Mzsrfylb_Yd a where a.fuwujgbh='330301001' and a.year='2016' and a.month='8' and rownum < 5

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧