做一个客户物资汇总表,要求给定一个时间,月,或天,查询全部客户或单个客户每天物资流向;分时间不同客户;不同物资;不同流向;尝试在ireport中坐统计 结果不能同时嵌套生效多个条件,求助不知是不是ireport使用错误;或者只能SQL语句实现;SQL语句不会写
现在的SQL语句 select weight.minecode minecode,
substr(weight.grosstime,0,10) qgrosstime,
c.custname custname,
v.vname vname,
pc.name custarea,
weight.zprice zprice,
weight.grossweight grossweight,
weight.tareweight tareweight,
weight.netweight netweight,
substr(weight.grosstime,0,10) grosstime
from
(select w.minecode minecode,
w.custno custno,
w.varno varno,w.grosstime grosstime,
s.custarea custarea,
nvl(w.netweight,0)*nvl(s.freightprice,0) zprice,
nvl(w.grossweight,0) grossweight,
nvl(w.tareweight,0) tareweight,
nvl(w.netweight,0) netweight
from sale_weight w, sale_notice s
where w.minecode = s.minecode(+)
and w.noticeno = s.noticeno(+)
and w.weightflag = '1'
and w.minecode = '7025' and w.grosstime>='2018-09-01 00:00:00' and w.grosstime<='2018-09-18 23:59:59')weight,
cust_custinfo c, pub_vardict v,pub_custarea pc
where weight.custno=c.custno(+)
and weight.varno=v.vcode(+)
and weight.custarea=pc.id(+)
order by substr(weight.grosstime,0,10),c.custname,v.vname,pc.name
图片上传失败 楼下试试回复上传
现在的SQL语句 select weight.minecode minecode,
substr(weight.grosstime,0,10) qgrosstime,
c.custname custname,
v.vname vname,
pc.name custarea,
weight.zprice zprice,
weight.grossweight grossweight,
weight.tareweight tareweight,
weight.netweight netweight,
substr(weight.grosstime,0,10) grosstime
from
(select w.minecode minecode,
w.custno custno,
w.varno varno,w.grosstime grosstime,
s.custarea custarea,
nvl(w.netweight,0)*nvl(s.freightprice,0) zprice,
nvl(w.grossweight,0) grossweight,
nvl(w.tareweight,0) tareweight,
nvl(w.netweight,0) netweight
from sale_weight w, sale_notice s
where w.minecode = s.minecode(+)
and w.noticeno = s.noticeno(+)
and w.weightflag = '1'
and w.minecode = '7025' and w.grosstime>='2018-09-01 00:00:00' and w.grosstime<='2018-09-18 23:59:59')weight,
cust_custinfo c, pub_vardict v,pub_custarea pc
where weight.custno=c.custno(+)
and weight.varno=v.vcode(+)
and weight.custarea=pc.id(+)
order by substr(weight.grosstime,0,10),c.custname,v.vname,pc.name
图片上传失败 楼下试试回复上传
解决方案 »
- oracle监听器可以启动,无权限关闭,很奇怪,求解!
- Oracle 问题急 哪位求助大侠
- 无法从源表中获取一组稳定的数据
- 停机时间延续性问题
- oracle7.3到oracle8i(8.1.6)的升级
- RAC的简单物理部署问题
- imp导入一个dmp文件时出问题!急求~~~~~
- 这条select 错在哪?
- 请教各位一个很奇怪的问题,oracle安装,事情很急,请多多帮忙
- 日期问题:to_date()函数
- EF链接Oracle在增删改查都没问题,执行事务时报dll异常
- 请教各位高人oracle中tnsnames.ora,listener.ora,sqlnet.ora三个文件的作用?最好能容易理。数据库启动时为何会分为三个状态?
GROUP BY 客户,物资,流向