Bestellungen auslesen
SELECT o.OXORDERDATE, oa.OXARTNUM, oa.OXTITLE, oa.OXSELVARIANT, oa.OXNETPRICE, oa.OXAMOUNT
FROM oxorder AS o
LEFT JOIN oxorderarticles AS oa ON o.OXID = oa.OXORDERID
ORDER BY o.OXORDERDATE
SELECT oa.OXARTNUM, oa.OXTITLE, oa.OXSELVARIANT, oa.OXNETPRICE, COUNT(oa.OXAMOUNT) AS OXAMOUNT, SUM(oa.OXNETPRICE) AS OXNETPRICETOTAL
FROM oxorderarticles AS oa
GROUP BY oa.OXARTID
ORDER BY oa.OXARTNUM