Hi,
For my assignment work I have to make 3 queries, and one of my queries includes a part that needs me to work out with orders have a total price above £70.
Here's the code I have so far:
SELECT SUM(Quantity*Price) As Total_Order_Cost FROM Orders
JOIN [Product_orders] ON [Orders].Order_ID = [Product_orders].Order_ID
JOIN [Products] ON [Product_orders].Product_ID = [Products].Product_ID
HAVING SUM(Quantity*Price) > 70
/*
This query shows how many times an order costing over £70 has been paid by VISA.
*/
But when I execute this query, it adds all of the orders together and generates one big total, but I want the totals of each row to be displayed, so that I can carry on with the next part of my query.
Anyone know how to do this?
Thanks.