MySQL Error: Incorrect usage of UPDATE and LIMIT
For the multiple-table syntax, UPDATE
updates rows in each table named in
table_references that satisfy the conditions. In this case, ORDER BY
and LIMIT
cannot be used
As per the MySQL docs for UPDATE:
For the multiple-table syntax, UPDATE updates rows in each table named in table_references that satisfy the conditions. In this case, ORDER BY and LIMIT cannot be used.
**if you want to update multiple rows using limit in mysql...directly limit you cant use try like this**
UPDATE table_name SET name='test'
WHERE id IN (
SELECT id FROM (
SELECT id FROM table_name
ORDER BY id ASC
LIMIT 0, 10
) tmp
);