2 u010990330 u010990330 于 2014.08.03 10:54 提问

mysql中表中列类型是枚举类型不能参与运算吗?

表结构:
+------------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+---------------------+------+-----+---------+-------+
| sporter_id | char(4) | YES | | NULL | |
| itemid | char(6) | YES | | NULL | |
| mark | enum('6','4','2','0','4','6','2','6','4')| YES | | NULL | |
+------------+---------------------+------+-----+---------+-------+
表内容:
+------------+--------+------+
| sporter_id | itemid | mark |
+------------+--------+------+
| 1001 | x001 | 6 |
| 1002 | x001 | 4 |
| 1003 | x001 | 2 |
| 1004 | x001 | 0 |
| 1001 | x003 | 4 |
| 1002 | x003 | 6 |
| 1004 | x003 | 2 |
| 1005 | x004 | 6 |
| 1006 | x004 | 4 |
+------------+--------+------+

select sporter_id,sum(mark) from grade
group by sporter_id;
为什么求不对?

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!