Last updated on November 23rd, 2022 at 08:52 am

Very simple query to find out the sum of multiple fields inside a mysql table.
Mysql
Lets say we have 2 numeric columns , COL1 and COL2 then the mysql query to find the sum of those two field is

Let us assume we have two columns with INT data type named VERSION and AVG_ROW_LENGTH. Then the query to find the sum will look like below
SELECT SUM(VERSION)+SUM(AVG_ROW_LENGTH) FROM TABLES;

Here is the screenshot of the query

You can also try this query to name the column as Output , change it to any name of your choice.

SELECT SUM(VERSION)+SUM(AVG_ROW_LENGTH) as Output FROM TABLES;

Leave a Reply

Your email address will not be published. Required fields are marked *