UPDATE `smartmeter_usage`.`users_reporting` SET panel_id = 3 LIMIT 1001, 1000
This query is incorrect (or at least I donβt know how to use the restriction in UPDATE queries), you must put the where clause on the primary key (this assumes that you have the auto_increment column as your primary key, unless you provide a more detailed information):
UPDATE `smartmeter_usage`.`users_reporting` SET panel_id = 3 WHERE primary_key BETWEEN 1001 AND 2000
For the second request you should use IS
UPDATE `smartmeter_usage`.`users_reporting` SET panel_id = 3 WHERE panel_id is null
EDIT - if your primary_key is a column named MAX + 1, you should query (with reverse steps, as noted in the comment):
UPDATE `smartmeter_usage`.`users_reporting` SET panel_id = 3 WHERE `MAX+1` BETWEEN 1001 AND 2000
To update rows from MAX + 1 from 1001 to 2000 (including 1001 and 2000)
Nicola Peluchetti Jun 09 2018-11-11T00: 00Z
source share