Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL To select from Multiple Tables
Message
 
 
À
03/04/2013 14:19:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01569456
Message ID:
01569959
Vues:
29
>Thanks, I Tried That One, Its Working but the initial Some 20-25 records are Repeated. Why is it so ? What the Error ?
>
>
>Select AMT.filename,AMT.invoiceno,AMT.phoneno,AMT.n_month,AMT.amtpayable,MSTR.exchange,MSTR.firstname,MSTR.lastName,MSTR.instaldate,PB.prevbal,LP.lastpayamt,;
>AD.adjamt,CR.curcharge,ACNT.acntbal,BILL.Fullpath From AMOUNTPAYABLE AMT LEFT JOIN MASTER MSTR on AMT.filename=MSTR.accountno;
>LEFT JOIN PREVBAL PB on AMT.filename=PB.filename;
>LEFT JOIN LASTPAYAMT LP on AMT.filename=LP.filename;
>LEFT JOIN ADJAMT AD on AMT.filename=AD.filename;
>LEFT JOIN CURRENTCHARGES CR on AMT.filename=CR.filename;
>LEFT JOIN ACOUNTBALANCE ACNT on AMT.filename=ACNT.filename;
>LEFT JOIN BILLS BILL on AMT.filename=BILL.filename
>
>
>
>
If you do a left join between 1 to many, you may get repeated information. The more JOINS you have the better chances that some information will be repeated. You only get non repeated info if all your JOINS are 1:1.

See also this blog post - may save you some grief later:

http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/aggregates-with-multiple-tables
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform