Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL - Select
Message
From
29/01/2003 11:31:16
 
 
To
29/01/2003 11:16:44
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00746724
Message ID:
00746738
Views:
23
SELECT Project, a.eocname, b.oecname, c.oecname;
  FROM Table2;
  LEFT JOIN Table1 a;
    ON Table2.Owner = a.oecid;
  LEFT JOIN Table1 b;
    ON Table2.Engineer = b.oecid;
  LEFT JOIN Table1 c;
    ON Table2.Contractor = b.oecid;
  INTO TABLE Table3
Is that what you mean?

Kev


>I have two tables with the following structure:
>
>Table 1
>oecid C(10)
>oecname C(50)
>
>Table 2
>Project C(50)
>Owner C(10)
>Engineer C(10)
>Contractor C(10)
>
>The 'Owner', 'Engineer' and 'Contractor' fields of Table 2 contain an 'oecid' from Table 1. What I would like to accomplish is to create a third table that contains 'Project','Owner Name','Engineer Name', and 'Contractor Name'. If someone could give me some direction on how to do this using an sql statement it would be greatly appreciated.
>
>Thanks in advance for your help,
>Russell
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform