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? 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 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? Link to comment https://forums.phpfreaks.com/topic/88445-mysql-add-cols/#findComment-452689 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.