Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combining two SQL statements
Message
From
05/06/2002 16:57:52
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Combining two SQL statements
Miscellaneous
Thread ID:
00665149
Message ID:
00665149
Views:
60
Hi:

Is there a way to combine the following into one SQL statement? I tried, but it didn't seem to work.

thanks,

Yossi
select arcash99->invno, ;
	sum(arcash99->paidamt) as cashpaid ;
	from arcash99 ;
	where empty(arcash99.artype) ;
	GROUP BY arcash99.invno ;
UNION ;
	select arycsh99->invno, ;
	sum(arycsh99->paidamt) as cashpaid ;
	from arycsh99 ;
	where empty(arycsh99.artype) ;
	GROUP BY arycsh99.invno ;
	INTO CURSOR CURS1

select CURS1->invno, ;
	sum(CURS1->cashpaid) as cashpaid ;
	from CURS1 ;
	GROUP BY CURS1.invno ;
	INTO CURSOR CURS2
Next
Reply
Map
View

Click here to load this message in the networking platform