Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL - Select
Message
De
29/01/2003 11:31:16
 
 
À
29/01/2003 11:16:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00746724
Message ID:
00746738
Vues:
24
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform