i have three tables in sql and i want to join them.
one of the tables are the menu (tab007-with 4 columns primary key, name of the menu, expenses and price) of a restaurant and the other one is the customers table (bestel) and the last one is the orders (post with four columns, primary key, primary key of first table, primary key of second table and number of orders) made this week.
i want to display which menu is the favorite one and which menu has the highest benefit for the owner of the restaurant.
i have tried a couple of select statements but with no success. i'll be happy to get help from here. here is my select statement:
(SELECT T.MID, T.NAME
FROM TAB007 AS T
INNER JOIN POST AS T1
ON T.MID=T1.MID)
SELECT SUM(ANZ) FROM T1.POST
GROUP BY MID;