samona Posted May 26, 2011 Share Posted May 26, 2011 Anyone have an idea of how to sum a calculated field. I have field A and field B. I create a new field called C and that equals the sum(A, B). Now i want a grand total of field C. Any ideas? Link to comment https://forums.phpfreaks.com/topic/237531-sum-calculated-field/ Share on other sites More sharing options...
Maq Posted May 26, 2011 Share Posted May 26, 2011 Please refer to the documentation next time: SELECT SUM(A + B) AS total FROM table_name; Link to comment https://forums.phpfreaks.com/topic/237531-sum-calculated-field/#findComment-1220624 Share on other sites More sharing options...
samona Posted May 26, 2011 Author Share Posted May 26, 2011 Thx! Where in the Doc? Link to comment https://forums.phpfreaks.com/topic/237531-sum-calculated-field/#findComment-1220631 Share on other sites More sharing options...
Maq Posted May 26, 2011 Share Posted May 26, 2011 thanks! Where in the Doc? http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_sum (There are also specific examples in the comments below) Link to comment https://forums.phpfreaks.com/topic/237531-sum-calculated-field/#findComment-1220633 Share on other sites More sharing options...
samona Posted May 26, 2011 Author Share Posted May 26, 2011 Bookmarked it. Thx again! Link to comment https://forums.phpfreaks.com/topic/237531-sum-calculated-field/#findComment-1220640 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.