Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECT SQL Help
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00552524
Message ID:
00552587
Vues:
12
I guess, I switched tables around: table1 is Table 2 and table2 is Table 1 in your message.
>
SELECT t1.projectid, ;
>      t2o.oecname AS OwnName, ;
>      t2e.oecname AS EngName, ;
>      t2c.oecname AS ConName, ;
>  FROM table1 t1 ;
>   JOIN table2 t2o ON t1.owner = t2o.oecid ;
>   JOIN table2 t2e ON t1.engineer = t2e.oecid ;
>   JOIN table2 t2c ON t1.contractor = t2c.oecid
>
>>I have two tables as follows:
>>
>>Table 1 has two fields, oecid and oecname. For example,
>>
>>MCOR1985..... 3M Corporation
>>ABBL1991..... ABB Lummus
>>BLAC2130..... Black & Veatch
>>
>>Table 2 has a multiple number of fields of which I am concerned with the following four: projectid, owner, engineer, and contractor. The owner, engineer, and contractor fields contain an 'oecid'.
>>
>>I want to be able to pull out the projectids whose owner,engineer or contractor 'oecid' matches an 'oecid' form Table 1. In addition, I would like to convert the 'oecid' in each of the owner, engineer, contractor fields to the corresponding 'oecname'.
>>
>>I hope this makes sense! Any suggestions would be greatly appreciated.
>>
>>Thanks in advance for your help,
>>Russell Clendenon
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform