Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL How to?
Message
De
10/01/2007 15:14:33
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
SQL How to?
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01184347
Message ID:
01184347
Vues:
57
How can I combine the following into one SQL statement? The problem I am having is the majority of the data is coming from one table, but the criteria for each field is different.
SELECT SUM(nloan_amount) as Total_Amt_CAP_Loans FROM loan.dbf WHERE UPPER(cstatus) = "ENROLLED" OR UPPER(cstatus) = "LOSS" OR UPPER(cstatus) = "PIF"

SELECT SUM(nloan_amount) as Total_Amt_Enrolled_Loans FROM loan.dbf WHERE UPPER(cstatus) = "ENROLLED"

SELECT SUM(nstate_reserve_payment) as nBDC_Reserve FROM loan.dbf WHERE UPPER(cstatus) = "ENROLLED" OR UPPER(cstatus) = "LOSS" OR UPPER(cstatus) = "PIF"

SELECT SUM(nborrower_reserve_payment) + SUM(nlender_reserve_payment) as nBank_Borrower_Reserve FROM loan.dbf WHERE UPPER(cstatus) = "ENROLLED" OR UPPER(cstatus) = "LOSS" OR UPPER(cstatus) = "PIF"

SELECT SUM(ytotal_claim_amount) as nClaims_Paid FROM claims.dbf
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform