Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL - Select
Message
 
To
29/01/2003 13:00:34
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00746724
Message ID:
00746794
Views:
25
>>Kevin,
>>
>>Thanks for the reply. However, when I tried this as follows
>>
>>SELECT Projectid, ;
>> a.oecname AS ownname,;
>> b.oecname AS engname,;
>> c.oecname AS conname ;
>> FROM curTemp1;
>> JOIN tmpoec a ON curTemp1.Owner = a.oecid;
>> JOIN tmpoec b ON curTemp1.Engineer = b.oecid;
>> JOIN tmpoec c ON curTemp1.Contractor = b.oecid;
>> INTO CURSOR curTEMP
>>
>>I get a table with each projectid being repeated for every oecid in the tmpOec table resulting in a huge resulting table. Have I left something out?
>
>Don't use a, b, and c as the local aliases for the tables; that can cause some confusion. Try it like this:
>
>SELECT Projectid, ;
> Own.oecname AS ownname,;
> Eng.oecname AS engname,;
> Cont.oecname AS conname ;
> FROM curTemp1;
> JOIN tmpoec Own ON curTemp1.Owner = Own.oecid;
> JOIN tmpoec Eng ON curTemp1.Engineer = Eng.oecid;
> JOIN tmpoec Cont ON curTemp1.Contractor = Cont.oecid;
> INTO CURSOR curTEMP
>
>Tamar

Tamar;

I seem to recall the letters A-J (work areas 1-10) were reserved and should not be used, although that may be almost pre-historic and of no consequence with later versions of the Fox. This is another case of being comfortable with how to write code and forgetting the details.

My preference is to not be cryptic and attempt to use an English like word whenever possible, that has meaning.

Tom
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform