Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECT-SQL
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00491132
Message ID:
00491455
Vues:
8
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform