Databases Reference
In-Depth Information
SUM (s.quantity*s.amount)Nettosumme
FROM [dbo].[iw_sales]s,
[dbo].[iw_article]a
where s.IWAN = a.IWAN
group by s.orderNo,a.article_No, a.[description])ord → Bestellungen
left outer join → Der outer join
(Select rh.orderNo ,a.article_No, a.[description],
SUM (rl.quantity)Anzahl,
SUM (rl.line_amount) Nettosumme
from [dbo].[iw_return_header]rh,
[dbo].[iw_return_line]rl,
[dbo].[iw_article]a
where rh.returnNo = rl.returnNo
and rl.IWAN = a.IWAN
group by rh.orderNo ,a.article_No, a.[description])ret → Retouren
on ord.orderNo = ret.orderNo
and ord.article_No = ret.article_No
Join über orderNo UND article_No
In Bild 20.3 sehen Sie, wie das Ergebnis der Abfrage ausschaut.
Bild 20.3■ Ergebnis der Bestellungen und Retouren auf Artikelbasis
Search WWH ::




Custom Search