MySQLSUM()
函数将返回0,而不是NULL,以及关于将字符类型列作为其参数的警告。以下示例使用名为“ Social”的表中的数据进行说明-
mysql> Select * from Social; +------+-------+ | Id | Name | +------+-------+ | 100 | Rahul | +------+-------+ 1 row in set (0.00 sec) mysql> Select SUM(Name) From Social; +-----------+ | SUM(Name) | +-----------+ | 0 | +-----------+ 1 row in set, 1 warning (0.00 sec)