12/9/2005
Using Subselect To Find Missing Rows
I have three tables items, colors, sizes; all related through a common primary key itemID. I noticed items has fewer rows than sizes and colors after a big import. How do I find which rows are missing from each table?
SELECT itemID
FROM sizes
WHERE itemID NOT
IN (
SELECT itemID
FROM items
)
FROM sizes
WHERE itemID NOT
IN (
SELECT itemID
FROM items
)
Popularity: 11%


