SUM
The SUM() function returns the total sum of a numeric column.
The following SQL statement finds the sum of the quantity fields in the order_details table:
Example
SELECT SUM(quantity)
FROM order_details;
Note: NULL values are ignored.
The SUM() function returns the total sum of a numeric column.
The following SQL statement finds the sum of the quantity fields in the order_details table:
SELECT SUM(quantity)
FROM order_details;
Note: NULL values are ignored.
Join CodingNow 2.0's PostgreSQL course — live mentorship, real projects, and 100% placement support.
Enroll Now — Free Demo AvailableQuick answers about learning PostgreSQL SUM in PostgreSQL.