ukweb Posted April 25, 2007 Share Posted April 25, 2007 Hi. I have a table in my database with records of payments. I have a query which selects all records for a specific user. How do I create a figure to represent all payments for that user, so if there are three records for 'fred' where he's made a 5, 22 and a 24 payment, the sum of which is 51. Would I do this at query level or some funky php code to add the values of all records in the query?? Thanks Stephen Quote Link to comment https://forums.phpfreaks.com/topic/48646-sum-of-values-in-column-of-query-help/ Share on other sites More sharing options...
Wildbug Posted April 25, 2007 Share Posted April 25, 2007 Chech out the aggregate GROUP BY functions such as SUM() Quote Link to comment https://forums.phpfreaks.com/topic/48646-sum-of-values-in-column-of-query-help/#findComment-238228 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.