PostgreSQL SyntaxLesson 24Free preview
PostgreSQL SUM
This lesson is part of PostgreSQL · All levels
Summary
The SUM function sums all the numerical values in a column and is often used to calculate the total transaction or inventory value. The value NULL is passed so that the number is always calculated from the line that is filled only. For accurate financial results, use the numeric type for the rupee column.
Key points
- SUM sums the numerical values of many lines into one result.
- The value of the line is passed, and the result is the value of the result when there is no value at all.
- Can be combined with WHERE to filter and GROUP BY for each group.
- For financial data, use the numeric type to keep accuracy.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.