Results 1 to 8 of 8
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    can left join be nested within left join? (97)

    can left join be nested within left join?
    I have a left join between a table & a query but require the query to have another left join from another table. Is it therefore possible to nest a left join within another left join?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: can left join be nested within left join? (97)

    Left and right joins are simply outer joins. The direction indicates the controlling side of the join. If you mean can two tables both have a left join with a third, then answer is yes. In fact, that's a common join with the controlling table is a join table for a many-to-many join. The From expression in that kind of join is typically something like this:

    FROM (trelJoin LEFT JOIN Table1 ON trelJoin.Key1 = Table1.Key) LEFT JOIN Table2 ON trelJoin.Key2 = Table2.Key

    If you're trying to do something else, you're going to have to explain further.
    Charlotte

  3. #3
    4 Star Lounger
    Join Date
    Jun 2001
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: can left join be nested within left join? (97)

    thanks Charlotte, I tried it out and was able to create a nested left join statement but I

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: can left join be nested within left join? (97)

    Since I haven't a clue as to what's in NewQuery or how it relates to anything, I can't be of much help. Nor do I understand exactly what you're trying to accomplish with this query. What's it actually *for*?

    You shouldn't need a month for each type in your month table. This appears to be one place where a cartesian product might be the desired result, but I can't see what you would use it for.
    Charlotte

  5. #5
    4 Star Lounger
    Join Date
    Jun 2001
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: can left join be nested within left join? (97)

    well my newQuery is just my main table with some expressions tacked onto it, kind of like the backbone of my reports, forms etc. all the major transaction data is in there.

    Btw, I tried this

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: can left join be nested within left join? (97)

    Post the entire SQL for the query. There's no way to guess at what the problem is based on the FROM clause alone.
    Charlotte

  7. #7
    4 Star Lounger
    Join Date
    Jun 2001
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: can left join be nested within left join? (97)

    well, sorry for not posting sooner Charlotte, I

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: can left join be nested within left join? (97)

    What I meant was the rest of the SQL that goes with this:

    FROM tblMonth LEFT JOIN newQuery ON tblMonth.type=newQuery.PromotionType
    Charlotte

Posting Permissions

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