I currently have a table that has 4 columns - valueone, valuetwo, valuethree and additioncolumn. I would like to know how to make the additioncolumn store the addition of valueone+valuetwo+valuethree.
I am new to MySQL and tried some syntax I found online and still no difference.
CREATE TABLE `calculation` (
`valueone` int(11) NOT NULL,
`valuetwo` int(11) NOT NULL,
`valuethree` int(11) NOT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
`additioncolumnn` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
INSERT INTO `calculation` VALUES (10,10,10,1,0),(20,20,20,2,0);
The value 0 there should be for the first row 30 and 60 for the second row.