php - sql 如何统计数字

标签 php mysql sql

我想计算数据库表中列的数字

这个例子:

enter image description here

39 + 23 + 9 = 71我怎样才能做到这一点?

mysql代码:

SELECT COUNT(column) as total from table

但它不起作用

提前致谢

最佳答案

试试这个:

SELECT SUM(column) as total from table

关于php - sql 如何统计数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40809451/

相关文章:

php - 显示(日历)周的第一天和最后一天

sql - 链接 Access 数据库 "record has been changed by another user"

php - 在 wordpress 网站中使用 paypal 按钮提交表单数据

php - 不在 mysql 子查询限制中

将数组中的数组传递给属性时,PHP SoapClient "deserialize error"

php - 可以连接到数据库但没有任何反应

mysql - Laravel 计数类别加入

php - 如何使用 Joomla Jtable 进行数据库事务

Mysql按时间间隔选择时间戳

mysql - 数据库设计可容纳多种项目类型