Now Place:2uzhan.com » natural join updates

natural join updates

PHP @ December 30, 1969   Views:0

can we do natural join updates in mysql like

update tab1

set tab1.address1 = '34 34st',
tab1.address2 = '',
tab1.zip = '10002'

from customer cus, company com where cus.id = '10' and cus.comid = com.comid


Should work assuming it doesn't mind some tables aliased and some not (I either alias them all or none of them).

However, the query you posted will update every row in tab1 because you didn't join it to the other two.

© 2018 2uzhan.com Contact