Page 1 of 1

JOIN vs INNER JOIN

Posted: Mon May 09, 2005 8:39 am
by Stryks
Hi all,

Just a quick question regarding the JOIN and INNER JOIN used in queries with mySQL.

Has there been some kind of change in the way queries must be structured or something just recently. Or perhaps it is a configuration issue.

Anyhow, I'm wondering why the following query:

Code: Select all

SELECT `tbl_user_address`.`UA_PK`, `tbl_user_address`.`Title` FROM `tbl_user_address` JOIN `tbl_master_postcodes` ON (`tbl_user_address`.`Locale` = `tbl_master_postcodes`.`MPC_PK`) WHERE (`tbl_user_address`.`USER_ID` = '25') ORDER BY `tbl_user_address`.`Default` DESC, `tbl_user_address`.`Title`
... gives me an error, until I modify it to read:

Code: Select all

SELECT `tbl_user_address`.`UA_PK`, `tbl_user_address`.`Title` FROM `tbl_user_address` INNER JOIN `tbl_master_postcodes` ON (`tbl_user_address`.`Locale` = `tbl_master_postcodes`.`MPC_PK`) WHERE (`tbl_user_address`.`USER_ID` = '25') ORDER BY `tbl_user_address`.`Default` DESC, `tbl_user_address`.`Title`
This is just a recent thing. I upgraded my server system and so have re-installed mysql / PHP / apache, and suddenly pretty much all of my queries which were joined with a straight JOIN are now broken unless I go through and change them to INNER JOIN.

Can anyone shed any light on this?

Cheers.

Posted: Wed May 11, 2005 7:52 am
by ody
Well the keyword 'JOIN' on it's own is very presumptuous about it's meaning which we would come to think of as your generic INNER. I think it's been changed to help remove any confusion out there and to help make queries more readable with the requirement of having to explicitly declare the JOIN type.