Re: LEFT JOIN and WHERE: identical or not and what is better?, etc.

2011-04-26 Thread Hal�sz S�ndor
2011/04/26 17:55 +0300, Andre Polykanine Aha. So, I should write SELECT `Blogs`.* INNER JOIN `Users` ON `Users`.`Id`=`Blogs`.`UserId` instead of my original WHERE clause? Thanks! I think so. -- MySQL General Mailing List For list archives: http://lists.mysql.com/my

Re: LEFT JOIN and WHERE: identical or not and what is better?, etc.

2011-04-26 Thread Andre Polykanine
://twitter.com/m_elensule Facebook: http://facebook.com/menelion Original message From: Halбsz Sбndor To: Andre Polykanine Date created: , 7:00:03 AM Subject: LEFT JOIN and WHERE: identical or not and what is better?, etc. >>>> 2011/04/25 17:42

Re: LEFT JOIN and WHERE: identical or not and what is better?, etc.

2011-04-26 Thread Suresh Kuna
I would go with join rather than where condition. 2011/4/26 Halász Sándor > 2011/04/25 17:42 +0300, Andre Polykanine > Here is the first one. > We have two queries: > SELECT `blogs`.* FROM `Blogs` LEFT JOIN `Users` ON > `Blogs`.`UserId`=`Users`.`Id`; > and the following o

Re: LEFT JOIN and WHERE: identical or not and what is better?, etc.

2011-04-26 Thread Hal�sz S�ndor
2011/04/25 17:42 +0300, Andre Polykanine Here is the first one. We have two queries: SELECT `blogs`.* FROM `Blogs` LEFT JOIN `Users` ON `Blogs`.`UserId`=`Users`.`Id`; and the following one: SELECT `Blogs`.* FROM `Blogs`, `Users` WHERE `Blogs`.`UserId`

Re: LEFT JOIN and WHERE: identical or not and what is better?

2011-04-25 Thread Joerg Bruehe
Hi Andre, everybody! Andre Polykanine wrote: > Hello everyone, > Sorry for my beginner question. Actually I have been using MySql for a > long time but I just start using some advanced things (earlier I > accomplished those tasks with PHP), so I will be asking stupid > questions, pl

Re: LEFT JOIN and WHERE: identical or not and what is better?

2011-04-25 Thread Johnny Withers
The only difference once MySQL parses these two queries is the first one is a LEFT JOIN, which will produce all records from the blogs table even if there is no matching record in the users table. The second query produces an INNER JOIN which means only rows with matching records in both tables wil

Re: LEFT JOIN and WHERE: identical or not and what is better?

2011-04-25 Thread Jo�o C�ndido de Souza Neto
I can be wrong about that, but I think the difference between them should be irrelevant so it makes me think about a paranoiac thought. For me, the only difference is: Chose the one you feel better to understand your code. Am I wrong or not? -- João Cândido de Souza Neto "Andre Polykanine"

Re: LEFT JOIN and WHERE: identical or not and what is better?

2011-04-25 Thread Mitchell Maltenfort
'where' is a filter. You're limiting records based on a criterion. 'on' is used for joining. On Mon, Apr 25, 2011 at 10:42 AM, Andre Polykanine wrote: > Hello everyone, > Sorry for my beginner question. Actually I have been using MySql for a > long  time  but  I  just  start  using some

LEFT JOIN and WHERE: identical or not and what is better?

2011-04-25 Thread Andre Polykanine
Hello everyone, Sorry for my beginner question. Actually I have been using MySql for a long time but I just start using some advanced things (earlier I accomplished those tasks with PHP), so I will be asking stupid questions, please bear with me. Here is the first one. We have two que