List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:March 8 2001 5:20pm
Subject:Re: optimising joins: where vs. using/on
View as plain text  
In the last episode (Mar 08), Christian Hammers said:
> While browsing old sources by a former employee I realised that he
> always did comma seperated joins and then a "where"
> 	FROM 
>           tablea a, tableb b, tablec c 
>         WHERE
>           a.id=b.id and b.nr=c.nr
> whereas I learned to do
> 	FROM
>           tablea a 
>           LEFT JOIN table b USING (id)
>           LEFT JOIN table c USING (nr)
> 
> Is one of the two ways preferred about the other? I like my way as it
> is easier to read and understand but would use anything to gain some
> speed in my 5+ hour selects...

They're two ways of expressing exactly the same thing.  MySQL treats
them identically internally.  Your LEFT JOIN syntax will only work if
the fields in both tables have the same name, though.  The WHERE syntax
can join any two fields together.

-- 
	Dan Nelson
	dnelson@stripped
Thread
optimising joins: where vs. using/onChristian Hammers8 Mar
  • Re: optimising joins: where vs. using/onDan Nelson8 Mar
  • Re: optimising joins: where vs. using/onSteve Ruby8 Mar
    • Re: optimising joins: where vs. using/onChristian Hammers8 Mar
  • Re: optimising joins: where vs. using/onSteve Ruby8 Mar
  • Re: optimising joins: where vs. using/onSteve Ruby8 Mar
  • Re: optimising joins: where vs. using/onSteve Ruby8 Mar
  • GETTING ROWSRandy Johnson10 Mar
    • RE: GETTING ROWSCal Evans10 Mar
    • Re: GETTING ROWSTac/Smokescreen Action Network10 Mar