aboutsummaryrefslogtreecommitdiff
path: root/opdracht-2/t7.sql
blob: a804a102b80bc74fa4e8bf97f8fd724a7eb750b0 (plain)
1
2
3
4
5
6
7
8
9
10
select
	`Order`.ID as OrderID,
	concat("product ", Product.ID, ", ", OrderProduct.Aantal, " stuks") as OrderInhoud,
	round(Product.Prijs * OrderProduct.Aantal) as Subtotaal
from OrderProduct
	left join `Order` on `Order`.ID = OrderProduct.OrderID
	left join Klant on Klant.ID = `Order`.KlantID
	left join Product on Product.ID = OrderProduct.ProductID
where Klant.ID = 1
group by OrderProduct.ProductID, `Order`.ID;