oracle加减乘除后sum,oracle怎么用别名来作为运算加减乘除!求大神解答 在等。。。...

这个是部分代码,这里能实现 下面的也就一样了!报错b.vehiclefee无效:

select b.vehiclefee

from (select round(sum(a.artifmate),0)|| null 人工费,round(sum(a.repailmate),0)|| null 材料费,

round(sum(a.vehiclefee),0)|| null 费用总和

from Vehiclerepair a where to_char(a.repaildate,'mm')=1) b

———————————————————————————————————————————————

这是完整代码 代码有点复杂!我的目的是用今年的8月份金额,减去上一年的8月份的金额

select round((sum(b.artifmate)-sum(c.artifmate)))|| null 人工费,

round((sum(b.repailmate)-sum(c.repailmate)))|| null 材料费,

round((sum(b.vehiclefee)-sum(c.vehiclefee)))|| null 费用总和

from (select round(sum(a.artifmate),0)|| null,

round(sum(a.repailmate),0)|| null ,

round(sum(a.vehiclefee),0)|| null

from Vehiclerepair a where to_char(a.repaildate,'mm')=1) b,

(select round(sum(t.artifmate),0)|| null,

round(sum(t.repailmate),0)|| null,

round(sum(t.vehiclefee),0)|| null

from Vehiclerepair t where to_char(t.repaildate,'yyyy')=2014 and to_char(t.repaildate,'mm')=1) c

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值