Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECT-SQL
Message
 
À
03/04/2001 14:31:34
David Brunelle
Université de Sherbrooke
Sherbrooke, Québec, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00491132
Message ID:
00491563
Vues:
8
Very interesting! So you don't use a WHERE clause at all? Or, if you do, how do you decide what goes in the WHERE and what goes in the JOIN?
zahid

>From what I know... The where clause happen after all the records has been filtered once with the JOIN. I'de use the AND because I'm pretty sure it is faster. Also, I had a problem once which make me want to use the AND from now on -).
>
>>Uh oh ... I get the feeling that I'm about to learn something new :)
>>
>>Arguably correct? Under what circumstances would it be beneficial to include filter conditions which filter the leftmost table of a LEFT JOIN inside the JOIN ... ON clause? In other words, why would
SELECT *
>>FROM Table1
>>LEFT JOIN Table2 ON Table1.key = Table2.key
>>AND Table1.otherfield = 'ABC'...
ever be preferable to
SELECT *
>>FROM Table1
>>LEFT JOIN Table2 ON Table1.key = Table2.key
>>WHERE Table1.otherfield = 'ABC'...
(other than to confuse the maintenance programmers? <g>)
>>
>>Thanks for the info!
>>zahid
>>
>>>>I think my post was correct. The KB article you reference indicates that
>>>>filter conditions affecting the right side of a LEFT JOIN clause should go in
>>>>the JOIN condition. Which is true. But the SQL that Randall posted included
>>>>filter conditions affecting the left side. Those have no business being in the
>>>>JOIN clause.
>>>
>>>Arguably correct.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform