Hi,
I've tried to search for what I expect to be an easy solution, but I've been searching a lot and at heart would still rather just do a subselect but MySQL is sublime nonetheless.
My need is to only select items in table 1 that ARE NOT in table two. Table one is a catalog list, and table two is a list of reserved items that are no longer available to offer.
Since joins require matching on the foreign key, how do I do this when I want all items in table 1 that do not match a foreign key in table 2
Here's a simplifications of what I'm attempting. Can you show me the light? Gratzie!
I've tried to search for what I expect to be an easy solution, but I've been searching a lot and at heart would still rather just do a subselect but MySQL is sublime nonetheless.
My need is to only select items in table 1 that ARE NOT in table two. Table one is a catalog list, and table two is a list of reserved items that are no longer available to offer.
Since joins require matching on the foreign key, how do I do this when I want all items in table 1 that do not match a foreign key in table 2
Here's a simplifications of what I'm attempting. Can you show me the light? Gratzie!
Code:
SELECT catalog_item.item_id FROM catalog_item, reserved_item WHERE catalog_item.item_id != reserved_item.item_id