Home >Database >Mysql Tutorial >mysql数据求和操作,更新问题

mysql数据求和操作,更新问题

WBOY
WBOYOriginal
2016-06-06 09:33:231249browse

mysql

BEGIN
INSERT INTO t_order_pricesum(r_company,priceSum)
SELECT r_company,sum(price) FROM t_order GROUP BY r_company;

END

我把t_order表中的数据筛选求和后插入t_order_pricesum里,
但t_order更新后再执行函数,因为原来有值了,无法更新,
怎么做才能在不删除t_order_pricesum表里的数据的情况下,更新数据。

Statement:
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