CartMetrix - Do you know yours?

« MySQL String Function Concat | Home | Force MySQL 4.1 to Use Old Style Passwords »

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
)

Popularity: 11%

Trackback:

Related Posts

Post your opinion

Verification Image

Please type the letters you see in the picture.

Subscribe without commenting


damonparker.org is proudly powered by WordPress
Entries (RSS) and Comments (RSS).

copyright © 2002-2008 damonparker.org. all rights reserved.

Close
E-mail It