1、mysql 修改字段名
alter table TableName change 原字段名 新字段名 新字段类型和大小
举例:mysql> alter table sales change porduct product varchar(30);
2、mysql 利用group by 的with rollup 子句做统计
mysql> select year,sum(profit) from sales group by year with rollup;
+------+-------------+
| year | sum(profit) |
+------+-------------+
| 2004 | 6006 |
| 2005 | 12039 |
| 2006 | 6033 |
| NULL | 24078 |
+------+-------------+
4 rows in set (0.00 sec)