Merlin wrote:

Hello ,

I have a sql problem which seems to be simple, but I am kind of stuck,

There are 2 tables with IDs. I would like to find out which ID from table
one is not in table 2.

My statement:
SELECT ap. *
FROM pictures p , album_pictures ap
WHERE ap.pic_id != p.pic_id

returns of course all the ids from table pictures which are not in table
album_pictures, but I would like to have
it the other way arround.

So you want all IDs in album_pictures that are not in pictures?

SELECT FROM album_pictures ap LEFT JOIN pictures p ON =

The people that "need" sub-selects for things like this need to learn some more SQL... but we're getting off topic. :)

---John Holmes...

Amazon Wishlist:

PHP|Architect: A magazine for PHP Professionals –

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to