Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combining two tables
Message
 
 
À
27/07/2012 11:25:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01549418
Message ID:
01549438
Vues:
71
This message has been marked as the solution to the initial question of the thread.
>Here is my unsimplified actual code using your suggestions; T1 is replaced with year1 and I also have to separate out the states and customers that correspond.
>
>
>SELECT NVL(Year1.fcustno,Year2.fcustno) AS custno,;
>  NVL(Year1.fcstate,"") AS state1, NVL(Year2.fcstate,"") AS state2,;
>  NVL(Year1.q1sum,0.00) AS y1q1sum, NVL(Year2.q1sum,0.00) AS y2q1sum;
> FROM ;
>     Year1 ;
>    FULL JOIN Year2 ;
>   ON  Year1.fcustno = Year2.fcustno;
>   AND  Year1.fcstate = Year2.fcstate
>
>
>
>This has the following problems.
>If we did not do business with a customer in year1 it is not showing up in the result even though we did do business in year2

If the JOIN conditions are correct, then all rows will show up correctly.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform