我想做个报告。根据我的要求,这并不难。我在此请求中指定日期和记录类型(正数或减数)。我希望此查询按contractorid、itemid和organization字段分组。从网上取款。
select
ID, DOCNUMBER,DOCDATE,PRINTNUMBER,DRIVERID,CONTRACTORID,ITEMID,
BRUTTO,TARE,NETTO,
DS_ID,
DAT_A,
MILEAGE,
ORGANIZATION,
sum(NETTO)
from WAYBILL
where trunc(DOCDATE) between to_date(:P115_D1,'dd.mm.yyyy')
and to_date(:P115_D2,'dd.mm.yyyy')
and DIRECTIONID = :P115_DIRECTIONID
group by
ID, DOCNUMBER,DOCDATE,PRINTNUMBER,DRIVERID,CONTRACTORID,ITEMID,
BRUTTO,TARE,NETTO,
DS_ID,
DAT_A,
MILEAGE,
ORGANIZATION
1条答案
按热度按时间lvmkulzt1#
似乎您希望显示完整的行,每个行都具有每个contractorid、itemid和organization的netto sum。您可以通过窗口功能实现这一点: