I created a SELECT query, after I execute it, it shows me a new table as I wanted (you can see it in the screenshot).
The problem is that I'm trying to add a new line to the query which supposes to sum() the column "Price" in the table that I got from the query
SELECT SUM(PRICE) AS totalPay
FROM Meals
You can see the tables here, and also the queries that worked at that, didn't.
I want it to be like that:
CodePudding user response:
Just add the SUM(price) as new field in your first SELECT. SELECT SUM(Meals.Price) as 'TotalPay', tableN01.waiterID FROM tableN01 INNER JOIN Meals etc.