Here I go again...
it really doesn't work... ? :-(

yes it does, but you have to be really careful with WHERE conditions in
outer joins



SELECT jobType.name, jobs.user, jobs.jobNo, jobs.jobType, jobs.hours,
jobs.day
FROM jobType
LEFT OUTER JOIN jobs ON jobs.jobType = jobType.id
WHERE jobs.id IS NULL
OR (
jobs.user = '4'
AND jobs.week = '2007-03-19'
AND (
jobs.day = '3'
OR jobs.day = '0'
)
)

this yields the Other jobtype, with no matching rows

;o)


i'm guessing that what you really want (which you never explained) is
something like this --

SELECT jobType.name
    , jobs.user
    , jobs.jobNo
    , jobs.jobType
    , jobs.hours
    , jobs.day
 FROM jobType
LEFT OUTER
 JOIN jobs
   ON jobs.jobType = jobType.id
  AND (
         (
         jobs.user = 4
     AND jobs.week = '2007-03-19'
         )
      OR (
         jobs.day in ( 0, 3 )
         )
      )


in outer joins, there is a big difference between conditions in the ON
clause and conditions in the WHERE clause


oh, and p.s., please do not make strings out of numbers to compare to numeric columns, it makes them soggy and hard to light

;o)


____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
      Send Your Posts To: wdvltalk@lists.wdvl.com
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: archive@jab.org
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.

Reply via email to