I'm working on a script where I need to use this code:
UPDATE articles
SET name="Alianza oro rosa y diamante ",
desc="Alianza oro rosa y diamante "
LIMIT 0, 1
What should I do to make it work?
It works if yu omit the 0,
:
UPDATE articles
SET name = "Alianza oro rosa y diamante ",
description = "Alianza oro rosa y diamante "
LIMIT 1;
As per documentation you cannot add an offset in the LIMIT
clause. Unfortunately LIMIT doesn't work in sub queries.
Check this Fiddle.
p.s.: potential solution (as per comment):
UPDATE articles
SET donttouch = false -- reset marker
WHERE donttouch = true;
UPDATE articles
SET donttouch = true
LIMIT 1; -- offset
UPDATE articles
SET name = "Alianza oro rosa y diamante ",
description = "Alianza oro rosa y diamante "
WHERE donttouch = false
LIMIT 1; -- number of entries
Tough this uses an addtional column (Fiddle).