MYSQL – 如何更新由选择语句分组产生的所有项目的字段
问题描述
我有一个这样的选择:
本文介绍了MYSQL – 如何更新由选择语句分组产生的所有项目的字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我有一个这样的选择:
我想更新结果行的 field_flag.我如何在 MySQL 中做到这一点? I want to update field_flag for the resulting rows. How can I do that in MySQL? 推荐答案 您的意思是要更新 select 语句返回的集合中的 field1、field2 和 field3 的表吗? Do you mean that you want to update table where field1, field2, and field3 are in the set returned by your select statement ? 例如.
请注意,更新可能会更新超过 1000 行. Note that the update might update many more than 1000 rows. 也可以使用临时表:
这样做的好处是可以稍后使用temptab,并且可以添加索引以加快更新: This has the advantage that temptab can be used later, and also that indexes can be added to speed up the update:
这篇关于MYSQL – 如何更新由选择语句分组产生的所有项目的字段的文章就介绍到这了mysql语句,希望我们推荐的答案对大家有所帮助,WP2 (编辑:通辽站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |