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)

    adding AND to JOIN

    Hi is it possible to add AND to a join query? if so what is the correct method.

    Ive tried this but it doesnt work.

    LEFT JOIN dbKarma
    ON dbPosts.post_id = dbKarma.karma_post_id
    AND
    dbPosts.user_id = dbKarma.karma_user_id

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,215
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by Jaynesh View Post
    Ive tried this but it doesnt work.
    there's nothing wrong with using an AND in the ON clause like that

    unfortunately, "doesn't work" is not enough information for further analysis
    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
  •