MySQL Forums
Forum List  »  Newbie

Re: UPDATE statement...can't use FROM?
Posted by: Scott Klein
Date: December 05, 2021 09:34PM

OK, I'd love to turn this into an update statement:

SELECT t1.col1, t1.col2, t1.col3 FROM table1 t1 INNER JOIN table2 t2 ON t1.id = t2.id GROUP BY t1.col1, t1.col2, t1.col3 HAVING SUM(t2.col1) = 0

So, can I do something like:

UPDATE table1 t1
INNER JOIN table2 t2 ON t1.id = t2.id
GROUP BY t1.col1, t1.col2, t1.col3
HAVING SUM(t2.col1) = 0

..or something similar?

Options: ReplyQuote


Subject
Written By
Posted
Re: UPDATE statement...can't use FROM?
December 05, 2021 09:34PM


Sorry, only registered users may post in this forum.

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.