"WITH ROLLUP" is a modifier used with the GROUP BY clause. Mainly, it causes the summary output to contain extra lines representing higher-level summary operations.
In the following example, the WITH ROLLUP modifier gives the summary output total price in an extra row.
mysql> Select Item, SUM(Price) AS Price from ratelist Group by item WITH ROLLUP; +------+-------+ | Item | Price | +------+-------+ | A | 502 | | B | 630 | | C | 1005 | | h | 850 | | T | 250 | | NULL | 3237 | +------+-------+ 6 rows in set (0.00 sec)
The above is the detailed content of What is the use of WITH ROLLUP modifier in MySQL?. For more information, please follow other related articles on the PHP Chinese website!