Unix Technical Forum

Beginners question on LEFT JOINS

This is a discussion on Beginners question on LEFT JOINS within the MySQL forums, part of the Database Server Software category; --> Yeah, I know this was KINDA covered in databases, but could somebody give me a refresher of what a ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 08:13 AM
John Meyer
 
Posts: n/a
Default Beginners question on LEFT JOINS



Yeah, I know this was KINDA covered in databases, but could somebody give me
a refresher of what a left join is in, say, terms of tables FOO and BAR.
Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 08:13 AM
Bill Karwin
 
Posts: n/a
Default Re: Beginners question on LEFT JOINS

"John Meyer" <john.l.meyer@gmail.com> wrote in message
news:BbCdnUllJ9IlJjDeRVn-uQ@comcast.com...
> Yeah, I know this was KINDA covered in databases, but could somebody give
> me
> a refresher of what a left join is in, say, terms of tables FOO and BAR.
> Thanks.


http://www.firstsql.com/tutor3.htm#outer

Regards,
Bill K.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 08:13 AM
John Meyer
 
Posts: n/a
Default Re: Beginners question on LEFT JOINS

Bill Karwin wrote:

>
> http://www.firstsql.com/tutor3.htm#outer
>
> Regards,
> Bill K.



Kind of get that one. It's a little bit harder to get my mind around that
one. For instance, listing all orders that don't have any items on them,
would that be an instance where you would use an OUTER/LEFT join.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 08:14 AM
Bill Karwin
 
Posts: n/a
Default Re: Beginners question on LEFT JOINS

"John Meyer" <john.l.meyer@gmail.com> wrote in message
news:GKidndMlHPZAUDDenZ2dnUVZ_sWdnZ2d@comcast.com. ..
> For instance, listing all orders that don't have any items on them,
> would that be an instance where you would use an OUTER/LEFT join.


Yes, probably. (it's hard to give a blanket answer because I don't know for
sure what your database structure is)

Here's another link that describes outer joins concisely and gives an
example:
http://en.wikipedia.org/wiki/Outer_join#Left_outer_join

I am reluctant to write a long description of how outer joins work, because
there are many resources on the internet that explain this already. Do a
google search for "sql outer join tutorial" or something.

I sympathize that the typical SQL book doesn't cover this topic well. Try
reading "SQL for Smarties" by Joe Celko.

Regards,
Bill K.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:04 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com