How to tell if primary key of one table is not in the current table
item (current table) category_item
-------|--- ---- ----------------|------------|----------
item_id item category_item_id| category_id| item_id
2119 1 16 2090
^primary key ^foreign key
I need a query that tells me that there is no record in the "category_item" table , that has the foreign key of any record table "item" category_item.item_id
In laymans terms I want to find out all record in "item" that do not have a "category" assigned to it.
This is true, where we cannot find any record in "category_item" that has the primary key of any of the records in table "ITEM" in the
category_item.item_i
The SELECT would item.item_id where get for e.g.
2113
2110
2310
each of which has no categories assigned yet.