Home >> MySql >> How do you find the sum of all the values in a column in MySql

How do you find the sum of all the values in a column in MySql

Find the sum of values of total column.

Example-1

SELECT SUM(price) FROM products

Example-2

Employee Table

Name              Salary
Raj                  20000
Ravi                10000
Ram                30000
Suresh            40000

Solution

SELECT SUM(salary) FROM employee;

Output 100000

Post Your Comment

Next Questions
How to find absolute value of a column
How do I get the absolute value of a column
How to find round value
How to get rounded data
How to find square root of a number
How to find the greatest value in a list
How to find the least value in a list
How To Find e raised to the power of the specified number
How to find a value extracted from a date
How to find a value extracted from a date or datetime
How to find a value extracted from an internal value

Copyright ©2022 coderraj.com. All Rights Reserved.