Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT-SQL
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00491132
Message ID:
00491455
Views:
9
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform