MySQL Forums
Forum List  »  Spanish

Re: Ayuda con un query para hacer update masivo en mysql
Posted by: Jesús Uzcanga
Date: January 25, 2016 10:17AM

Albert, es perfectamente posible hacer lo que necesitas.

Un ejemplo sin tus datos para abreviar.

UPDATE tablaA
INNER JOIN tablaB on campo1.tablaB=campo1.tablaB
SET campox.tablaA='123'
WHERE campo2.tablaA='x' AND campo2.tablaB='y'

NOTA1: Eel INNER JOIN puede ser sustituido por LEFT JOIN o RIGHT JOIN según tus necesidades.

NOTA2: Haciendo esto tu where está bien así como lo tienes en el SELECT.

___________________________
Ing. Jesús Alfredo Uzcanga
Twitter: @JesusUzcanga

We learn the 20% of what we HEAR,
the 50% of what we SEE,
the 80% of what we DO and
the 95% of what we TEACH.

____________________________________________________________
https://www.linkedin.com/in/jauzcanga/

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Ayuda con un query para hacer update masivo en mysql
1491
January 25, 2016 10:17AM


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.