select * from t1;
+--------+
| deptno |
+--------+
| 10 |
| 10 |
| 10 |
| 20 |
| 20 |
| 20 |
| 20 |
| 30 |
| 30 |
| 30 |
| 30 |
| 30 |
| 30 |
+--------+
13 rows in set (0.00 sec)
1水平直方图返回结果集如下所示,*号个数为对应DEPTNO的记录数。
查询:
mysql> select deptno,lpad('',count(),'*') cnt from t1 group by deptno;
2垂直直方图返回结果集如下所示,*号个数为对应DEPTNO的记录数。
查询: