Results 1 to 8 of 8
  1. #1
    Join Date
    May 2003
    Posts
    22

    Unanswered: need some SQL advice!

    Source = "select Development.[KinderNumber],Development.[Date],Development.[Client],Development.[MFG],Development.[Fixture],Development.[Dimensions (HxWxD)],Development.[MFG Price],Development.[Item Number], dp.[Image], dp.[Revision_ Letter] FROM developmentpictures dp, Development WHERE dp.[KinderNum]= Development.[KinderNumber] AND dp.[Revision_ Letter] IN(select max([Revision_ Letter]) from developmentpictures where kindernum = dp.kindernum)


    here is my SQL statement that works perfect....although when I add a LEFT or RIGHT JOIN it wont work??


    Please help!!!

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    add?

    you have a "table list" join in there right now, it might be better to rewrite that with JOIN syntax first

    then when you add a third table, you have to parenthesize the joins

    e.g.

    from (
    tableA join tableB
    on tableA.id = tableB.A_id
    )
    join tableC
    on tableB.id = tableC.B_id


    rudy

  3. #3
    Join Date
    May 2003
    Posts
    22
    well... can you go into more detail for me please...not understanding what you are saying to me

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    um, not sure what part you don't understand

    if you've never done JOIN syntax before, this could turn out to be a long thread...

    if you're joining 3 tables, which one's the "left" table, the one that you want all rows of, whether or not they have matches in the other table(s)?

    rudy

  5. #5
    Join Date
    May 2003
    Posts
    22
    I am joining 2 tables and I want all the DEVELOPMENT PICTURES to be returned...hopefully this helps

    if you would prefer to send e-mail I am @

    JFOUSE@CAROLYNKINDER.COM




    Originally posted by r937
    um, not sure what part you don't understand

    if you've never done JOIN syntax before, this could turn out to be a long thread...

    if you're joining 3 tables, which one's the "left" table, the one that you want all rows of, whether or not they have matches in the other table(s)?

    rudy

  6. #6
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    what's the relationship? one D to many DPs, or one DP to many Ds? which table has the primary key, and which one the foreign key?

  7. #7
    Join Date
    May 2003
    Posts
    22
    one D to many DP's although I am only returning one DP for one D but with the JOIN on statement I want to return the one DP regardless of the D.....


    Originally posted by r937
    what's the relationship? one D to many DPs, or one DP to many Ds? which table has the primary key, and which one the foreign key?

  8. #8
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    "I want to return the one DP regardless of the D"

    which one?

    if it's the one with the highest letter, see http://dbforums.com/showthread.php?threadid=791653

Posting Permissions

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