0 votes

How do I make my column show the sum of two other columns?

What I want is that my column progresototal show the result of the sum of the columns progreso1 y progreso2 of each row.

For example my user of id = 1 has as its value in column progreso1 = 30 y progreso2 = 25 I want that in the column progresototal the result of the sum of progreso1 y progreso2 that is to say 55 automatically.


Carlos A Points 3

introducir la descripción de la imagen aquí

I hope I have been able to help you. Good luck, and if you need only one row, use where id = "id";

The columns that are integer type, you can add them without so much fuss in the following way (column1 + column 2) as total sum, as well as subtraction, multiplication, division. Now that in your columns you have numbers (only numbers) and they are of type varchar you will have to convert them to integer.


HolaDevs is an online community of programmers and software lovers.
You can check other people responses or create a new question if you don't find a solution

Powered by: