Sarchophagi
Sarchophagi

Reputation: 386

How to use ORDER BY and LIMIT with UPDATE?

Its straight forward. I have no multiple tables.

How can I get the following SQL to work?

"UPDATE table SET (...) WHERE (...) LIMIT 2 ORDER BY something"

Upvotes: 0

Views: 422

Answers (1)

juergen d
juergen d

Reputation: 204914

The keywords have to be in the correct order. Put limit to the end

UPDATE table 
SET (...) 
WHERE (...)  
ORDER BY something
LIMIT 2

Upvotes: 3

Related Questions