[what's the default here?] JOIN

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

[what's the default here?] JOIN

Post by JellyFish »

I was wondering what the kind of join is a join when you write just JOIN, without anything in front of it, such as, INNER or CROSS. In other words, what is the default type of join when you don't specify anything in front of the keyword JOIN in a SQL query?

Just a quick question I wasn't able to find answered at MySQL.com.
User avatar
volomike
Forum Regular
Posts: 633
Joined: Wed Jan 16, 2008 9:04 am
Location: Myrtle Beach, South Carolina, USA

Re: [what's the default here?] JOIN

Post by volomike »

INNER JOIN, and the same thing as a comma:

http://dev.mysql.com/doc/refman/5.0/en/join.html

http://forums.mysql.com/read.php?20,213 ... msg-213755

But don't believe me -- try it for yourself with some sample data.
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Re: [what's the default here?] JOIN

Post by JellyFish »

Oh okay. Thanks for that.

INNER and CROSS are both the same right? And they both produce a Cartesian products (that is, without a ON or USING clause)?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: [what's the default here?] JOIN

Post by VladSun »

There are 10 types of people in this world, those who understand binary and those who don't
Post Reply