MySQL joins? What are they? When to use them?
I am probably going to get slaughtered for this, and told to read the manual (which I have, but it has not helped my understanding).
I working with MySQL more and more at the moment, but I cannot get my head around joins, I know there are multiple types of join, i.e Inner, Outer, Left, Right but I do not what the differences are between them or what the adavantages of using one over the other is.
I find myself 开发者_StackOverflow中文版more and more just using left joins as I know the syntax, however I am now worried that maybe this good put my applications at a disadvantage in terms of speed and maybe I should be using other joins depending on what my needs are?
I really like this explanation: http://www.codeproject.com/KB/database/Visual_SQL_Joins.aspx It shows all kinds of JOIN's and has a nice overview. Make a hardcopy and glue it on your door.
I love this post !!!
http://www.codinghorror.com/blog/2007/10/a-visual-explanation-of-sql-joins.html
its a visual explanation (by diagrams) make it pretty clear.
精彩评论