oracle报错:不是单组分组函数

sum(decode(p.requi_form, '1', r.bid_amount, 0)) b,sum(decode(p.requi_form, '2', r.bid_amount, 0)) c,sum(decode(p.requi_form, '3', r.bid_amount, 0)) d,sum(decode(p.requi_form, '4', r.bid_amount, 0)) e,sum(p.bid_amount) 采购金额,sum(r.bid_...
oracle报错:不是单组分组函数
非聚集函数列,要刚到group by 列表中:

select fno,max(decode(category,'l1',value)) l1,max(decode(category,'l2',value)) l2,max(decode(category,'l3',value)) l3,max(decode(category,'l4',value)) l4,max(decode(category,'l5',value)) l5,max(decode(category,'l6',value)) l6 from tablegroup by fno2014-07-16
select p.requi_form,
sum(decode(p.requi_form, '0', r.bid_amount, 0)) a,
sum(decode(p.requi_form, '1', r.bid_amount, 0)) b,
sum(decode(p.requi_form, '2', r.bid_amount, 0)) c,
sum(decode(p.requi_form, '3', r.bid_amount, 0)) d,
sum(decode(p.requi_form, '4', r.bid_amount, 0)) e,
sum(p.bid_amount) 采购金额,
sum(r.bid_amount) 招标采购金额,
sum(r.bid_amount) / sum(p.bid_amount) 招标采购率
from cg_purchase_project p,
cg_purchase_report r
where r.purc_pro_id = p.purc_pro_id
and p.purc_pro_state != 11
group by p.requi_form
order by p.bid_team;2014-07-16
mengvlog 阅读 54 次 更新于 2025-12-17 17:41:08 我来答关注问题0
檬味博客在线解答立即免费咨询

报错相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部