Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with SQL
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00004043
Message ID:
00004089
Vues:
31
Let's Try again:
Select A.*, Sum(B.x) as Calc_Amt ;
From A, B ;
Where (Link condition) ;
UNION ;
Select A.*, 0.0 as Calc_Amt ;
From A ;
Where (A.Account+A.Aie_Code NOT IN ;
(SELECT B.Account+B.ItemCode FROM B)
INTO AleSum

or What I prefer and is faster on large data sets:

Select A.*, Sum(B.x) as Calc_Amt ;
From A, B ;
Where (Link condition) ;
INTO DBF AleSum

Select A.*, 0.0 as Calc_Amt ;
From A ;
Where (A.Account+A.Aie_Code NOT IN ;
(SELECT B.Account+B.ItemCode FROM ALESUM);
INTO Cursor T1

if _Tally # 0
SELE T1
xDbf=DBF()
SELE AleSum
Append from (xDBF)
ENDIF


HtwH...
Steve Medvid
Systems Analyst

Environmental Resource Management
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform