May 2020
Beginner
564 pages
14h 9m
English
ROLLUP in Oracle, PostgreSQL, and SQL Server uses a different syntax, as shown in the following query:
USE lahmansbaseballdb; SELECT playerid, teamid, sum(AB) AS sum_at_batsFROM batting GROUP BY ROLLUP (playerid, teamid)ORDER BY playerid, teamid;
The following screenshot shows the results of running the previous query:

Oracle, PostgreSQL, and SQL Server ROLLUP subtotals and grand totals in the same way as MySQL. If you scroll to the bottom of the results, you will see a grand total with playerid and teamid set to NULL.
Read now
Unlock full access