Home > Database > Mysql Tutorial > mysql存储过程如何遍历查询结果并更新到另一张表

mysql存储过程如何遍历查询结果并更新到另一张表

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 09:33:07
Original
2565 people have browsed it

mysql遍历存储

sql查出来的结果集:
查询结果,返回memberid
表:t_bm_integral
需要更新的表
第一张图里边的sql查出了一个结果集 里面包含 包含memberid 和integral字段,现需要把这个结果集里面的integral插入或更新到第二张图里边表(表名:t_bm_integral)的integral字段(如果第一张图里边的memberid在第二张图里边存在则更新其integral,不存在则把第一张图里memberid和integral字段作为一条新的记录插入),存储过程语句怎么写?

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