我想更新表中从 1001 到下一个 1000 的行.
I want to update rows in my table with starting from 1001 to next 1000.
我尝试了以下查询:
UPDATE `oltp_db`.`users` SET p_id = 3 LIMIT 1001, 1000
此外,我尝试更新的行的 p_id 列具有 Null 值,该列的数据类型为 INTEGER.因此,我什至无法使用以下查询进行更新:
Also, the rows that I am trying to update are having Null value for the column p_id which is having data type INTEGER. Due to this I am not even able to update using following query:
UPDATE `oltp_db`.`users` SET p_id = 3 WHERE p_id = null
处理空值时,=
与空值不匹配.您可以使用 IS NULL
或 IS NOT NULL
When dealing with null, =
does not match the null values. You can use IS NULL
or IS NOT NULL
UPDATE `smartmeter_usage`.`users_reporting`
SET panel_id = 3 WHERE panel_id IS NULL
LIMIT
可与 UPDATE
一起使用,但仅与 row count
一起使用
LIMIT
can be used with UPDATE
but with the row count
only
这篇关于MySQL - 使用 LIMIT 更新查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!