Darkmatter5 Posted September 16, 2009 Share Posted September 16, 2009 I have 3 fields in a table called allo_hp, allo_mp and allo_mp and I'm wanting to add up the numbers in each of those fields and have that sumed result aliased out as total. How can I go about doing that? Quote Link to comment https://forums.phpfreaks.com/topic/174499-sum-some-fields-in-a-select-query/ Share on other sites More sharing options...
gevans Posted September 16, 2009 Share Posted September 16, 2009 You can do the following; SELECT (`allo_hp` + `allo_mp` + `allo_theotherone`) as `total` FROM `your_table` Quote Link to comment https://forums.phpfreaks.com/topic/174499-sum-some-fields-in-a-select-query/#findComment-919708 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.