1

I am trying to use limit with update in mysql but is giving an error

Error: MySQL Error: Incorrect usage of UPDATE and LIMIT

update table1
JOIN table2 
  ON SUBSTRING_INDEX(table1.HOST, '.',1)= SUBSTRING_INDEX(table2.HOST, '.', 1)
set table1.portalId = table2.portalId
limit 2;
1

2 Answers 2

0

However, you cannot use ORDER BY or LIMIT with a multiple-table UPDATE.

From the official reference

It's also the exact text shown when you search google for "mysql update limit".

Sign up to request clarification or add additional context in comments.

Comments

0

LIMIT can be used with UPDATE but with the row count only. You can try doing an inner select which may be more complicated but you may just be able to use your desired limit in there

MYSQL Reference

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.