How to update two tables but limit one row?
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, t2.data = 9 where t1.id = t2.parentId and t1.id = 378 and t2.timestamp > 1549706000 order by t1.id desc limit 1;
ERROR 1221 (HY000): Incorrect usage of UPDATE and ORDER BY
Thank you.
Subject
Views
Written By
Posted
How to update two tables but limit one row?
1183
February 09, 2019 05:36PM
529
February 09, 2019 05:38PM
575
February 09, 2019 08:28PM
425
August 14, 2019 06:12AM
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.