Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combine two tables
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00066400
Message ID:
00066828
Vues:
32
>>
>>Chu, if you are working in VFP5 then you can set up the SQL using the "left outer join" syntax. However, you will probably have to do it outside a view and then use Create View to put the view in the DBC. I don't think the View wizard will handle anything this complicated. You may also have to have the product table opened under separate aliases for the different codes or use a series of SQL-Select statements. If this is true, then you may need to put the code in a PRG or a method instead of a view.
>>
>>HTH
>>Barbara
>
>Barbara, I solved the problem by the following code.
>
>SELECT a.order_num, b.p_name as p_name1, c.p_name as p_name2, d.p_name as p_name3, ;
>FROM order a ;
>LEFT JOIN prod_dct b ON a.p_code1=b.p_code ;
>LEFT JOIN prod_dct c ON a.p_code2=c.p_code ;
>LEFT JOIN prod_dct d ON a.p_code3=d.p_code ;
>INTO CURSOR order
>
>Is it correct? Thanks a lot.
>
>Chu

Chu, it looks fine. I see you DID need to USE the P_Name table with different aliases. Congratulations!

Barbara
Barbara Paltiel, Paltiel Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform