Could anyone offer some help please?!...
I have an sql database table called meals and another database table called menu:
meals (id, name, description, cost)
menu (date, option1, option2)
The idea being that there are 2 meal choices in a given day, for example:
09/02/16 meal id 1 OR meal id 8
10/02/16 meal id 4 OR meal id 12
I want to use a join statement similar to this:
select * from meals JOIN menu ON meals.id = menu.option1 AND meals.id=menu.option2
but every time I run this I get an error message, saying table alias not unique.
I want the final output to display:
date: option 1 meal id, name, cost AND option 2 meal id, name, cost
e.g.
09/02/16 - 1(id) Chicken curry £2.50 + 8 (id) Roast Beef £3.00
10/02/19 4 (id) Baked potato £2.50 + 12 (id) Soup/Sandwiches £2.75
select * from meals mea INNER JOIN menu men ON mea.id = men.option1 OR mea.id=men.option2OR, notAND.