Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Proper syntax for a compound join
Message
From
29/07/1999 01:49:26
Walter Meester
HoogkarspelNetherlands
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00247208
Message ID:
00247534
Views:
16
Jim,

>If the combination of two fields comprises the primary key of a table, then those two fields should be in an index together so records can be found with a simple seek. Joins are based on the relationship of the primary key of one table and the foreign key in another table.

Well, here you have a point. For readability reason I might do the same thing

>The issue of data types is irrelavent. Data conversions are possible.

>WHERE STR(CustNo,10,0) + STR(InvNo,10,0) = ...

Yes, of course, But here you create a key which could not be as usable as two index keys (when it does not regard a PK or FK) because of rushmore optimization in other parts of the program. I simply try to avoid composite keys as much as posible.

>Using an AND in a JOIN condition is more complicated in my opinion as it conceals the PK and FK values

Well I think its just a matter of taste. Using the AND follows the ANSI SQL92 syntax while this solution might only apply to VFP.

Walter,
Previous
Reply
Map
View

Click here to load this message in the networking platform