Example 1
Sum all order amounts
SUM(amount) collapses all remaining rows into one numeric total.
Source table data Rows loaded before the example query runs.
Setup
CREATE TABLE orders (id INT, amount INT);
INSERT INTO
orders (id, amount)
VALUES
(1, 40),
(2, 35),
(3, 25);Validated query Shared across supported engines.
SQL
SELECT
SUM(amount) AS total_amount
FROM
orders;Expected result Returned rows for the shared example.
| total_amount |
|---|
| 100 |
Validated across all four engines with identical aggregate output.