Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any alternative ways for this SQL statement?
Message
From
18/07/2000 02:47:05
Walter Meester
HoogkarspelNetherlands
 
 
To
18/07/2000 02:33:19
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00393654
Message ID:
00393659
Views:
16
Hi John,

Does it have to be a single SQL statement. The best (and easiest) thing to do is to store the inner SELECT into a cursor and querie the outher one on the cursor like:
SELECT SUM(addlog.tran_bal) AS TTotal, SUM(0) AS PTotal
    From Addlog ;
UNION ;
SELECT SUM(0) AS Total,  SUM(eftlog.tran_bal) AS PTotal
    FROM eftlog ;
    INTO CURSOR x

SELECT SUM(TTotal), SUM(PTotal)
    FROM x ;
    INTO CURSOR Result
Walter,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform