示例在下面的示例中,with rollup 修饰符给出了摘要输出总价位于额外行中。
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)
以上就是mysql中with rollup修饰符有什么用?的详细内容。
