Home > Backend Development > PHP Tutorial > 数组求和()

数组求和()

WBOY
Release: 2016-06-13 10:44:39
Original
1078 people have browsed it

数组求和(求助)
表 test 有字段 CODE 和 MONEY,如何按照code将money求和

------解决方案--------------------
$sql= "select code, sum(money) as money from test group by code";

这只是sql语句。你都没有执行查询,想输出什么呢?
------解决方案--------------------
select code ,sum(money) from test group by code having code='$cc'

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template