mysql update 语句 left join 提取多条数据中的最大字段值
问题:
对于 student 表和 score 表
如何使用 mysql update 语句结合 left join,将 student 表中的 score 字段更新为对应 score 表中最大的 score 值?
解答:
update student set score=(select max(score) from score where score.student_id=student.id)
上一篇:笔记本电脑内存占用率高怎么解决
下一篇:解析 ThinkPHP 的命名空间
服务热线
截屏,微信识别二维码
微信号:
(点击微信号复制,添加好友)
打开微信