mysql - 使用单个 mysql 查询进行多次更新

标签 mysql sql-update

我需要用不同的值更新多行。可以在 mysql 中做吗? 即,像这样的事情

UPDATE landing_page SET (rotation_slot_begin='0',rotation_slot_end='0.333333333333' where landing_pageid=265),(rotation_slot_begin='0.333333333333',rotation_slot_end='0.666666666667' where landing_pageid=267),(rotation_slot_begin='0.666666666667',rotation_slot_end='1' where landing_pageid=268)  

但是这个查询不起作用。我想是这样的。任何人都可以帮助我

最佳答案

Here是我之前已经发布的解决方案。

关于mysql - 使用单个 mysql 查询进行多次更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2682350/

相关文章:

具有三重连接的 MySQL 自表更新

sql - MS Access 更新并增加先前记录

mysql - 不退出重新进入MySQL命令行刷新数据

android - Sqlite根据where子句android更新一列

mysql - mysql表中插入重复数字

PHP for every 在 while 循环中从表中选择

C# 更新 Access 数据库中的 boolean 值

mysql - mysql中的binlog是什么?

mysql - 如何防止用户更改电脑时间并修改mysql中插入行的时间戳

php - 如何在PHP中单独输出表列值?