Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select joining same table multiple times
Message
 
À
05/07/2000 23:16:33
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00388673
Message ID:
00388955
Vues:
9
>
Hi Cathi,
>
>   You could try opening the customer table multiple times.
>
>E.g.
>
>   SELECT contract.id, c1.lastname, c2.lastname, c3.lastname ;
>        , c4.lastname, c5.lastname, c6.lastname
>       FROM contract, customer c1, customer c2, customer c3 ;
>          , customer c4, customer c5, customer c6 ;
>       WHERE c1.custid = contract.custid1 ;
>       AND   c2.custid = contract.custid2 ;
>       AND   c3.custid = contract.custid3 ;
>       AND   c4.custid = contract.custid4 ;
>       AND   c5.custid = contract.custid5 ;
>       AND   c6.custid = contract.custid6 ;
>   INTO TABLE blahblah
>
>This would only work though if all six id fields had values in them.
>
>Hope this helps
>Gavin...
>

Thanks for your suggestion. I forgot about using a different alias for each of the different custids'. I modified this to include OUTER JOINS and it works great. Thanks for your help.
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform