>Although correct, many people consider this bad style - the ON clause
>of the JOIN should contain only the join condition(s). So it would be
>better to say

Yes indeed but here the 'zip' condition is in the join for the possibility that the constant zip condition could speed up the join. See Shawn's excellent response.

PB

-----

Harald Fuchs wrote:
In article <[EMAIL PROTECTED]>,
Peter Brawley <[EMAIL PROTECTED]> writes:

  
Scott, sorry, my mistake,
  SELECT price
  FROM fedex_zones z
  INNER JOIN fedex_rates r ON z.zone=r.zone AND z.zip=94947
  WHERE r.weight = 25;
PB
    

Although correct, many people consider this bad style - the ON clause
of the JOIN should contain only the join condition(s). So it would be
better to say

  SELECT price
  FROM fedex_zones z
  JOIN fedex_rates r ON z.zone = r.zone
  WHERE r.weight = 25
    AND z.zip = 94947


  
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.8 - Release Date: 5/10/2005

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to