MySQL Forums
Forum List  »  InnoDB

How to update two tables but limit one row?
Posted by: nobody nobody
Date: February 09, 2019 05:36PM

Apparently the mysql does not allow update multiple tables to use order limit, but I need the update only be limited to a single row, how could I do it?

mysql> update t1, t2 set t1.lastContact = 1549706102, t2.timestamp = 1549706102, = 9 where = t2.parentId and = 378 and t2.timestamp > 1549706000 order by desc limit 1;
ERROR 1221 (HY000): Incorrect usage of UPDATE and ORDER BY

Thank you.

Options: ReplyQuote

Written By
How to update two tables but limit one row?
February 09, 2019 05:36PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.