Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Percent of total help
Message
 
To
12/05/2005 09:10:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01012865
Message ID:
01013352
Views:
11
SELECT account, ClassCode, SUM(amount) AS subtotal ;
	FROM mytable ;
	GROUP BY account, ClassCode ;
	INTO CURSORS crsST

SELECT mt.account, mt.amount, ROUND(mt.amount/st.subtotal,2) AS percentage 	
	FROM mytable mt ;
	JOIN crsST st ON st.account+st.ClassCode = mt.account+mt.ClassCode ;
	INTO CURSOR crsResult
That is if the Account it Char type
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform