mysql update from another table


UPDATE contacts_New p, users pp
SET pp.last_name = concat(p.desig, ' ',p.dept)
WHERE pp.username = p.eid

Lets say we have 2 tables one named contacts_New and one named users .

I waana update users last_name field from contacts_New p.desig, ' ',p.dept field. use above query.

Comments