I've also wanted to know which of the following is the better approach
Does it actually have a difference???
where table1.userid = table2.userid
using the proper join statments such as Inner join
I've also wanted to know which of the following is the better approach
Does it actually have a difference???
where table1.userid = table2.userid
using the proper join statments such as Inner join
I think the best way is the syntax you feel more comfortable with.
I like the old joining syntax using the where clause but alot of people like the new syntax, I believe because of readability especially on outer joins where it shows in regular text that you are performing a LEFT or RIGHT join.
There is no performance difference that I am aware of but I could be wrong.
cgyrob is correct. In general for simple joins there is no performance difference. If you have larger complicated queries with several filters and joins or subqueries, strictly for readability it would be better to use the proper JOIN syntax so the filters and join conditions can easily be separated.
Keep in mind you can not do FULL OUTER JOINS in MySQL (I'm not sure if you can in version 6. I haven't upgraded yet). But there are work arounds. =)
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.