identifying records not in a table
I have just realised I am missing a foreign key constraint in one of my tables. :(
so now I need to find what records of the menus (child), table, are not in the menus_sequencer (parent), table.
this query gives me back nearly 400 reaulsts, which is just about all of them and surely, that is not the correct result.
FROM menus as m
join menus_sequencer as ms
on ms.business_id = m.business_id
ms.content_category != m.content_category
and ms.menu_name != m.menu_name
This next query gives me over 5000 results when there are only 68 and 84 records respectively, in each table.
FROM menus AS m
join menus_sequencer AS ms
ON ms.content_category = m.content_category
ms.menu_name != m.menu_name
what way should I be writing this query?