Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Problem in 3 files
Message
De
23/07/1997 09:20:51
Jp Steffen
Leadership Data Services
Des Moines, Iowa, États-Unis
 
 
À
23/07/1997 08:47:37
Vinod Parwani
United Creations L.L.C.
Ad-Dulayl, Jordanie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00041299
Message ID:
00041306
Vues:
60
>I have 3 files, 1 parent & 2 child
>
>When I give statment like :-
>
>sele parentfield, child1, child2 from parent, child1, child2 where parent.code=child1.code and parent.code=child2.code
>
>It shows me double records i.e.
>
>if a parent record is having 2 child records in each file, it is showing me 4 records, instead of 2. (values are getting repeated).
>
>Any Ideas/suggestions ??

Vinod

Your result is exactly what you would expect and want in most case where each of the three tables contains variable (unique) data relative to the parent.code. It sounds as though you expect 1 parent record with 2 merged records from child1 and child2. Since as you seem to indicate the data in the child records is duplicated, you must SQL the two child tables first and group them to one record per code. Then SQL this cursorof mreged child tables with the parent table.

(It begs the question, "If both child tables are twin children of a parent - maybe they should be one table instead of two)

Well anyway, grouping is the key, some way or another.

JP
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform