Re: [PHP-DB] simple sql problem

2003-07-25 Thread John W. Holmes
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 cour

Re: [PHP-DB] simple sql problem

2003-07-25 Thread George Patterson
On Fri, 25 Jul 2003 02:31:39 -0600 Stephen March <[EMAIL PROTECTED]> wrote: > Any database that supports nested queries (unfortunatly this excludes > MySQL) ... you can do > Subselects are supported in MySQL 4.1 ... :-) > select pic_id from pictures where pic_id not in (select pic_id >

Re: [PHP-DB] simple sql problem

2003-07-25 Thread Stephen March
Any database that supports nested queries (unfortunatly this excludes MySQL) ... you can do select pic_id from pictures where pic_id not in (select pic_id from album_pictures) Otherwise you might have a harder time with MySQL ... something like set difference if it supports it (I'm not s