Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
3 table join
Message
De
16/02/2011 16:32:04
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01500313
Message ID:
01500450
Vues:
36
>>Thanks for the code but it doesn't seem to give the desired result.
>>
>>For each PK in main the result should create N records where N = the largest number of matching records in Parts or Tools.
>>
>>main.pk = 1 has 2 parts records and 1 tools records so there should be 2 records in the result for pk = 1
>>main.pk = 2 has 1 parts record and 3 tools records so there should be 3 records in the result for pk = 3
>>
>>Your query gave 4 records for PK = 1 and 1 record for PK = 2 (and that record didn't find the matching tool record)
>>
>>It's looking as if I may need to rethink the entire process. My result would be fine if we were to export as an Excel spreadsheet (something we do often) but developing a hard copy REPORT FORM may be problematic.
>>
>>Thanks again........Rich
>>
>Rich,
>
>Did you have a chance to look at my suggestion? I assume that FK in both tables are sequential numbers with no gaps (if not, we need to add the numbers per each partition - a bit complex in VFP).

Yes. I've looked at your suggestion and responded to it. With a little tweak it gave the result I was looking for.

FK in Tools and Parts indicates the owning record from MAIN. The records in MAIN are not required to have any tool and/or parts record but the final result should include those records (NULL values for pno, tno, etc are acceptable).
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform