SUM Function in SQL
Level 242 keystrokes
SUM adds up the values of a numeric column and ignores NULL values.
SQL code
1SELECT -- SUM adds up quantity over all rows of orders -- NULLs are ignored; if all values are NULL, SUM returns NULL, not 02 SUM(quantity) AS total3FROM4 orders;Output
+-------+ | total | +-------+ | 150 | +-------+ 1 row in set
Practice typing this code. Results are not recorded in the rankings.
Symbols in this code
The symbols you type in this SQL code and how often they appear.
;× 1(× 1)× 1