UPDATE table SET checked = 1 WHERE field = 'xxx' LIMIT 1
works fine, but
UPDATE table SET checked = 1 WHERE field = 'xxx' LIMIT 1, 10
throw error “#1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ 10’ at line 1“
Why it is not possible? I want to update everything except first row.
LIMITin anUPDATEclause is merely an upper limit on how many rows may be updated.It’s not like in a
SELECTwhere you can ignore all but a certain subrange of result rows to deal with.If you really need something like this, you should use a
VIEWwith theLIMITrestriction, and perform theUPDATEon that.