Discuz! Board

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1405|回复: 0

基于sql查询结果的批量更新

[复制链接]

697

主题

1142

帖子

4086

积分

认证用户组

Rank: 5Rank: 5

积分
4086
发表于 2018-5-4 09:49:47 | 显示全部楼层 |阅读模式
update d_config a,(SELECT d_config_id as dConfigId, count(d_config_id) as hots FROM d_config_time where create_time >=date_sub(CONCAT(CURDATE(),' 00:00:00') ,interval 90 day) group by d_config_id) b set a.hots=a.level+b.hots, a.update_time = now()
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|firemail ( 粤ICP备15085507号-1 )

GMT+8, 2024-4-17 00:39 , Processed in 0.055375 second(s), 20 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表