SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Sep 2006
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    join inside a join

    Is it possible to add a join inside a join for e.g

    Code:
    LEFT JOIN 
    
    (dbFriends LEFT JOIN dbPosts_share ON dbPosts_share.share_user_id = dbFriends.friend_id)
    
    ON
    (dbPosts.username_id = dbFriends.my_id
    OR 
    dbPosts.username_id = dbFriends.friend_id)

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,250
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    no

    joins are serial

    start with a table, join a second table, then join another table, then join another table, etc.

    and you're still messing around with ORs, aren't you

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


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
  •