【发布时间】:2015-01-16 06:29:22
【问题描述】:
我正在尝试更新 mysql 中的行,但对于单值 mysql 查询,我必须使用 for 循环进行多次更新
update table set column1='100' where id =1
update table set column1='100' where id =6
update table set column1='100' where id =14
我正在使用 for 循环多次运行具有不同 ID 的查询,我想运行单个查询以更新所有行。这可能吗?
我想做这样的事情
update table set column1='100' where id=1,6,14;
【问题讨论】:
-
@saharsh:实际上不希望像 [whree-clause] 那样添加尽可能多的标签。这并没有真正增加问题的任何内容。
标签: mysql sql sql-update where-clause in-operator