Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to I do a SUM on multiple fields
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00411539
Message ID:
00411543
Views:
11
>See if this works:
>
>SELECT FieldID, SUM( Total1 ) AS Total1, SUM( Total2 ) AS Total2 ;
>FROM TableName ;
>GROUP BY FieldID
>
>>I want to do a SQL SELECT and I want to do a group and then many sums on fields that will be a part of that group.
>>
>>example:
>>
>>FieldId Total1 Total2
>>1 2 3
>>1 4 5
>>2 3 2
>>2 1 2
>>
>>the result that I would like to have after the select is
>>
>>FieldId Total1 Total2
>>1 6 8
>>2 4 4
>>
>>
>>How do I do that?

It looks OK from some tests that I did. If not at least it looks like I'll be on the right track.

Thanks Chris!
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Previous
Reply
Map
View

Click here to load this message in the networking platform