I have db in MySQL, with two tables and I need to make query like this
SELECT a.*, b.* from db1.A a1 left join db2.A a2 using(id) where a1.email <> a2.email
So i would like to find guys who has non empty email field in db1.A table and their emails does not match the same guys email from db2.A, and write emails from db1.A to db2.A.
in the beginning we have
db1.A db2.A
email email
www@ww.ww NULL
in result ii would like to get
db1.A db2.A
email email
www@ww.ww www@ww.ww
I can make it with any script language, but can it be done (such tasks) with help only SQL ?
Seems to me it can be easily achieved by next query:
thanks everyone.