Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Statement
Message
 
 
To
03/05/2000 08:42:03
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00365519
Message ID:
00365529
Views:
15
John,
SELECT ;
		"Total Amount of Table 1" AS Descript, SUM(Amount1) AS Amount;
	FROM Table1 ;	
UNION SELECT ;
		"Total Amount of Table 2" AS Descript, SUM(Amount2) AS Amount;
	FROM Table2 ;	
UNION SELECT ;
		"Total Amount of Table 3" AS Descript, SUM(Amount3) AS Amount;
	FROM Table3 	
>Hi,
> I have 3 tables. I need to generate a summary report as the following
>
>
>Table1
>No.     Date1         Amount1
>1      1/1/2000     1000
>2      1/1/2000     2000
>
>Table2
>No.     Date2         Amount2
>1      1/1/2000     3000
>2      1/1/2000     4000
>
>Table3
>No.     Date3         Amount3
>1      1/1/2000     6000
>2      1/1/2000     7000
>
>
>My expected summary report is
>Report
>Total Amount of Table1:     3000
>Total ................:     7000
>Total ................:    13000
>
>Total                 :    23000
>
>Any ideas with how the SQL statement should be?
>
>Thank you
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform