I want to update rows in my table with starting from 1001 to next 1000.
I tried with following query:
UPDATE `oltp_db`.`users` SET p_id = 3 LIMIT 1001, 1000
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
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
can be used with UPDATE
but with the row count
only