SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    936
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Arrow Determining LEFT or RIGHT join table?

    I know this is very basic question.

    But i just want to remove my confusion.

    How do i know if the table is in the LEFT side or RIGHT side?

    Thank you.

  2. #2
    SitePoint Enthusiast
    Join Date
    May 2007
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if your put table at left side then it in the left side.

  3. #3
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    936
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    if your put table at left side then it in the left side.
    ha ha very funny answer.

    anyone can answer this question properly please.

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,246
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by solidcodes View Post
    How do i know if the table is in the LEFT side or RIGHT side?
    by figuring out which table you want to have all rows from

    if you say A inner join B, then you get only rows from each table that match

    if you say A left outer join B, then you get all rows from A, plus matching rows from B, if any

    if you say A right outer join B, then you get all rows from B, plus matching rows from A, if any

    so it depends on what you want
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  5. #5
    SitePoint Evangelist barbara1712's Avatar
    Join Date
    Apr 2007
    Location
    India
    Posts
    509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dont know much about the joins
    Why should we use joins?

    what is the difference between
    if you say A left join B, then you get all rows from A, plus matching rows from B, if any

    and

    if you say A left outer join B, then you get all rows from A, plus matching rows from B, if any
    Barbara

  6. #6
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,246
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    the difference is only the optional keyword OUTER

    why should you use joins? because they're faster than retrieving data from one table, then using the key values to get rows from the second table by performing a query in a loop

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

  7. #7
    SitePoint Evangelist barbara1712's Avatar
    Join Date
    Apr 2007
    Location
    India
    Posts
    509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks a lot r937.
    One more about locking.
    I have read about locking,but I still did not get the exact mechanism like
    what is the meaning of read or write . What about row lenel locking?

    Can you give me a link so that I can know the locking mechanism?
    Barbara

  8. #8
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    936
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Very smart answer r937.

    You are really a true SQL consultant.

    I'll try my best to follow your foot steps...

  9. #9
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,246
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by barbara1712 View Post
    Can you give me a link so that I can know the locking mechanism?
    sure -- da manual

    http://dev.mysql.com/doc/refman/5.0/...ng-issues.html

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

  10. #10
    SitePoint Evangelist barbara1712's Avatar
    Join Date
    Apr 2007
    Location
    India
    Posts
    509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks,
    really you are true SQL consultant.

    i will go through the manual.
    Barbara


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
  •