mysql 多表更新
来源:互联网 发布:大旗软件 编辑:程序博客网 时间:2024/05/23 13:47
UPDATE yi_user a
set
freezeamt=freezeamt-
(
select sum(fee) from bp_drawout b
where
b.srcType='Y'
and b.dstatus=4
and b.srcid=a.yuid
GROUP BY
b.srcid
),
amt=amt+
(
select sum(fee) from bp_drawout b
where
b.srcType='Y'
and b.dstatus=4
and b.srcid=a.yuid
GROUP BY
b.srcid
)
where
a.yuid in (
select b.srcid from bp_drawout b
where
b.srcType='Y'
and b.dstatus=4
GROUP BY
b.srcid
)
set
freezeamt=freezeamt-
(
select sum(fee) from bp_drawout b
where
b.srcType='Y'
and b.dstatus=4
and b.srcid=a.yuid
GROUP BY
b.srcid
),
amt=amt+
(
select sum(fee) from bp_drawout b
where
b.srcType='Y'
and b.dstatus=4
and b.srcid=a.yuid
GROUP BY
b.srcid
)
where
a.yuid in (
select b.srcid from bp_drawout b
where
b.srcType='Y'
and b.dstatus=4
GROUP BY
b.srcid
)
阅读全文
0 0
- mysql多表更新
- mysql多表更新
- mysql 多表更新
- mysql 多表更新
- MySQL--多表更新
- MYSQL多表联合更新
- MySQL多表更新实例
- mysql 多表级联更新
- mysql 多表关联更新
- MySql 实现多表更新
- mysql 多表关联更新
- mysql单表更新及多表更新
- mysql单表更新及多表更新
- mysql 单表更新和多表更新
- mysql 数据库多表更新语句
- mysql下updete多表联合更新
- 29、MySQL-多表更新与删除
- MySQL联合多表更新和删除
- maven 手动安装
- js切割url后面?字符串方法
- 待学习&复习的内容
- 设计模式简介
- Excel的基础操作
- mysql 多表更新
- PHP中MySQL、MySQLi和PDO的用法和区别
- 关于gridview多item选中放大问题。
- 容斥原理
- 两种基于AOP的日志管理方法(springboot)
- Storm架构
- HDR技术研究之Radiometric Self Calibration
- Luogu P3120 [USACO15FEB]牛跳房子(金)Cow Hopscotch (Gold)
- Java并发编程--Lock的用法