Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL To select from Multiple Tables
Message
De
03/04/2013 14:25:12
 
 
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:
01569962
Vues:
29
In your Suggested SQL also the First Two records are Same. Why ? How to Overcome That ?


I have Gone Through the Tutorial Provided in the Link. Now I am able to use LEFT JOIN to Merge Two Tables as per my Requirement. I am using this Command
>>
>>
>>Select A.FileName,A.InvoiceNo,A.Phoneno,A.N_month,A.Amtpayable,M.ExCHANGE,M.FIRSTNAME,M.LASTNAME,M.INSTALDATE
> FROM AMOUNTPAYABLE A LEFT JOIN MASTER M ON A.FileName=M.AccountNo
>>
>>
>>But Now I have another Table and yet another. In Such cases How will I now Add. Suppose I need Column PREVBALAMT From PREVBAL. PREVBAL has also the same common filed FIlename. What Would be the revised SQL For adding Multiple Tables.
>>
>>
>>
>Just keep LEFT JOINing to your other tables e.g.
>
>
>Select A.FileName,A.InvoiceNo,A.Phoneno,A.N_month,A.Amtpayable,Mstr.ExCHANGE,Mstr.FIRSTNAME,Mstr.LASTNAME,Mstr.INSTALDATE
> FROM AMOUNTPAYABLE A LEFT JOIN MASTER Mstr ON A.FileName=Mstr.AccountNo
>LEFT JOIN PrevBal PB ON A.FileName = PB.FileName
>
>Also, it's a bit dangerous to use a-m letters as aliases of the tables in the select statement when we're talking about VFP data. You may better use 2 letter aliases.
Harsh
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform