1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
select distinct
api.Get_Part_Product_Family('01',ref),
transaction,
sum(cost*quantity) over (partition by api.Get_Part_Product_Family('01',ref))
--entrée - sortie
(select
sum(cost*quantity) over (partition by api.Get_Part_Product_Family('01',ref))
from ifsapp.inventory_transaction_hist2
where transaction = 'EA'
)
-
(select
sum(cost*quantity) over (partition by api.Get_Part_Product_Family('01',ref))
from ifsapp.inventory_transaction_hist2
where transaction = 'SA'
)
from
ifsapp.inventory_transaction_hist2
where
transaction in ('EA', 'SA','RET CLI', 'REBUT')
and dated between to_date('&date_debut') and sysdate
order by api.Get_Part_Product_Family('01',ref),
transaction |
Partager