MySQL LIMIT on DELETE statement
DELETE t.* FROM test t WHERE t.name = 'foo' LIMIT 1
@Andre If I understood what you are asking, I think the only thing missing is the t.* before FROM
.
the delete query only allows for modifiers after the DELETE 'command' to tell the database what/how do handle things.
see this page
From the documentation:
You cannot use
ORDER BY
orLIMIT
in a multiple-tableDELETE
.
simply use
DELETE FROM test WHERE 1= 1 LIMIT 10