Изменения в новых версиях / SQL:1999

-- *** before: ***
-- subtotals meant a UNION ALL of several GROUP BY queries
SELECT Continent, Region, SUM(Population) FROM country GROUP BY Continent,
    Region
UNION ALL
SELECT Continent, NULLSUM(Population) FROM country GROUP BY Continent
UNION ALL
SELECT NULLNULLSUM(Population) FROM country

-- *** in version 1999: ***
SELECT Continent, Region, SUM(Population) AS Total
FROM country
GROUP BY ROLLUP (Continent, Region)

-- CUBE gives every combination, GROUPING SETS lists them by hand:
-- GROUP BY GROUPING SETS ((Continent), (Region), ())

-- Support: Oracle since 8i (ROLLUP and CUBE) and 9i (GROUPING SETS),
-- MS SQL Server 2008 in the standard spelling, PostgreSQL 9.5. MySQL
-- has only the older GROUP BY ... WITH ROLLUP and no CUBE. SQLite,
-- Firebird and Access have none of the three.