Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to join 3 tables
Message
From
21/10/2003 19:00:26
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
21/10/2003 18:55:08
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00840872
Message ID:
00840885
Views:
18
>>If you need to join the SECOND table to the third, the syntax becomes a little more involved; you have to insert stuff between the JOIN and ON, thusly:
>>
>>
>>sele a.pn ;
>>   from pnvendor a;
>>      left join inv b;
>>         left join Table3 on b.KeyField = Table3.KeyField;
>>      on a.pn = b.pn ;
>>   where [SomeCondition]
>>
>>
>>Note that I alligned the first LEFT and the last ON, to indicate they go together.
>>
>
>Actually, you don't have to.

Yes, I know. Allignment is irrelevant for VFP. It helps the programmer keep things clear - and the reason I pointed this out is to indicate which commands go together. Understanding this can be important for more complicated queries.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform