Hi Everyone.
 
I have the following SELECT statement the get information from two tables.
The statement only works when it finds a value for the image_archive.circuit
value in the circuits table. However, not all entries in the database has a
value in the this field, some are set to 0 as the circuit for that image was
not known or the image was not a circuit.
 
SELECT   image_archive.filename, 
      image_archive.year, 
      image_archive.month, 
      image_archive.driver_forename, 
      image_archive.driver_surname, 
      image_archive.team,
      image_archive.event, 
      circuits.name as circuit_name, 
      image_archive.description, 
      image_archive.title, 
      image_archive.membership_no
FROM   image_archive, circuits
WHERE  image_archive.id = 109
AND   circuits.id = image_archive.circuit
 
How can I modify the statement to allow it to return a record when the
image_archive.circuit value is 0, but to return the circuit name when the
value is greater than 0. At the moment when the circuit value is 0 no
records are returned even though I know the rest of the information is in
the image_archive table. Hope that makes sense. Thanks in advances for any
help.
 
BTW, I am using 4.0.18.

Best Regards

   >>> Andrew

SpamNet - Stop spam immediately and help me too!
 <http://www.cloudmark.com/spamnet> www.cloudmark.com/spamnet 
Referral Code: 2tc4hl 
(use the code a get spamnet for $1.99 per month instead of $4.99!!!)

Reply via email to