-- SAMPLE
SELECT year, SUM(sales) FROM booksales GROUP BY year WITH ROLLUP;
+------+------------+
| year | SUM(sales) |
+------+------------+
| 2014 | 17 |
| 2015 | 18 |
| NULL | 35 |
+------+------------+
SQL Справочник v0.05 © 2007-2025 Igor Salnikov aka SunDoctor