Victor,
Wednesday, May 29, 2002, 12:01:31 AM, you wrote:

VSA> Tells a great deal about how confused I am...

VSA> I've a database with three tables, one with image data, one with 
VSA> categories and one table which helps me to have several categories per 
VSA> image...

VSA> The following SQL gives me _all_ the images that has at least one 
VSA> category associated:

VSA> SELECT images.filename, images.path, images.desc, categories.name FROM 
VSA> images, relate, categories WHERE public = 1 AND relate.fromid = 
VSA> images.id AND relate.toid = categories.id

VSA> But what I need help with is getting all the images that has no 
VSA> categorie associated with them in the table relate...

Something like that:

SELECT images.filename, images.path, images.desc FROM images
LEFT JOIN relate ON images.id=relate.fromid
WHERE relate.fromid IS NULL;

VSA> Someone, please...
VSA> Sincerely,
VSA> Victor




-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to