SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    USA
    Posts
    1,407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    help with 3 table outer join query

    I have three tables:

    table1:
    table2_ID
    table3_ID
    complete

    table3:
    table3_ID
    name

    table2:
    table2_ID
    table4_ID

    Given table3.table3_ID, I need to retrieve the value of table1.complete OR "Not Complete".

    I have tried this in several different iterations without success.

    SELECT
    IF(ISNULL(e.complete), e.complete,'Not Complete') as complete
    FROM table3 s
    RIGHT OUTER JOIN table1 e ON e.table3_ID = s.table3_ID
    INNER JOIN table2 t ON t.table2_ID = e.table2_ID
    WHERE s.table3_ID = 2993
    AND t.table4_ID = 10029

    Any ideas are much appreciated!
    Last edited by WebDevGuy; Jan 23, 2006 at 12:04.

  2. #2
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    ya, you need a left join, not a right join.

  3. #3
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    USA
    Posts
    1,407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks longneck - you are always a big help


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •