alin19 Posted January 29, 2008 Share Posted January 29, 2008 let's say that i have three fields in one table: month january | month february | total 30 30 january+february 39 32 january+febrary how can i do this? Quote Link to comment https://forums.phpfreaks.com/topic/88445-mysql-add-cols/ Share on other sites More sharing options...
craygo Posted January 29, 2008 Share Posted January 29, 2008 $sql = "SELECT january, february, SUM(january+february) as total FROM tablename GROUP BY id"; Ray Quote Link to comment https://forums.phpfreaks.com/topic/88445-mysql-add-cols/#findComment-452670 Share on other sites More sharing options...
alin19 Posted January 29, 2008 Author Share Posted January 29, 2008 can i insert a formula direct in mysql coll? Quote Link to comment https://forums.phpfreaks.com/topic/88445-mysql-add-cols/#findComment-452689 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.