Wymień wszystkie elementy, które nie były częścią żadnego zamówienia. SQL
SELECT * FROM Items
WHERE itemID NOT IN
(SELECT itemID FROM ItemsInOrder)
Fancy Flamingo
SELECT * FROM Items
WHERE itemID NOT IN
(SELECT itemID FROM ItemsInOrder)
SELECT DISTINCT I.*, ITO,itemID AS [NULL if never ordered]
FROM Items As I
LEFT JOIN
ItemsInOrder AS ITO
ON I.itemID=ITO.itemID
WHERE ITO,itemID IS NULL