I'm trying to detect missing links in my tables.
The SQL below revealed 16 rows (2 orders) in the ITEMS table, which do *not* have a matching entry in the ORDERS table.
SELECT orders.orderID, items.orderID, items.itemcode, items.quantity, items.pricequote
FROM orders RIGHT JOIN items
ON orders.orderID = items.orderID;
eg:
ITEMS ORDERS
OID OID
123 123
123
123
123
126 No entry
126
127 127
I would like the SQL to show ONLY the rows that exist in the ITEMS table that do *not* have a matching order table entry. In this case:
126
126
Any assistance welcome.
Thanks.
The SQL below revealed 16 rows (2 orders) in the ITEMS table, which do *not* have a matching entry in the ORDERS table.
SELECT orders.orderID, items.orderID, items.itemcode, items.quantity, items.pricequote
FROM orders RIGHT JOIN items
ON orders.orderID = items.orderID;
eg:
ITEMS ORDERS
OID OID
123 123
123
123
123
126 No entry
126
127 127
I would like the SQL to show ONLY the rows that exist in the ITEMS table that do *not* have a matching order table entry. In this case:
126
126
Any assistance welcome.
Thanks.