1054 - Unknown column 'score' in 'group statement
mysql> select cno,max(grade) AS '最高分',min(grade) AS '最低分',round(avg(grade),2) AS '平均分',count(*) AS '学生数量'from t_score group by score;
1054 - Unknown column 'score' in 'group statement'
mysql> select cno,max(grade) AS '最高分',min(grade) AS '最低分',round(avg(grade),2) AS '平均分',count(*) AS '学生数量'from t_score group by cno;
+------+--------+--------+--------+----------+
| cno | 最高分 | 最低分 | 平均分 | 学生数量 |
+------+--------+--------+--------+----------+
| C01 | 98 | 41 | 62.38 | 34 |
| C02 | 88 | 43 | 66.47 | 34 |
| C03 | 98 | 46 | 68.78 | 25 |
| C04 | 98 | 40 | 72.17 | 25 |
+------+--------+--------+--------+----------+
4 rows in set
1064 - You have an error in your SQL syntax;
mysql> select max(grade) AS '最高分',min(grade) AS '最低分',avg(grade) AS '平均分',count(*) AS '学生数量'from t_score where cno='C01';
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',min(grade) AS '最低分',avg(grade) AS '平均分',count(*) AS '学生' at line 1
mysql> select max(grade) AS '最高分',min(grade) AS '最低分',avg(grade) AS '平均分',count(*) AS '学生数量'from t_score where cno='C01';
+--------+--------+--------+----------+
| 最高分 | 最低分 | 平均分 | 学生数量 |
+--------+--------+--------+----------+
| 98 | 41 | 62.375 | 34 |
+--------+--------+--------+----------+
1 row in set
使用了中文逗号