Winston Liek wrote:Thanks for reply.
I am using Mysql. I'm wondering what's the efficient way to do this since the data in the table is more than a thousand
Do you have an idea how to do this if multiple sqls can be used?
Winston Liek wrote:In my example, is this correct:
SQL 1:
UPDATE Table1 tbl1
JOIN Table2 tbl2 ON tbl1.ID = tbl2.ID
SET tbl1 .age = tbl2.age
WHERE tbl1 .age is NULL
SQL2:
UPDATE Table1 tbl1
JOIN Table2 tbl2 ON tbl1.name= tbl2.name
SET tbl1.age = tbl2.age
WHERE tbl1.age is NULL
[/code]
Winston Liek wrote:
and also what does your quote mean?
Winston Liek wrote:I am using Mysql. I'm wondering what's the efficient way to do this since the data in the table is more than a thousand
Do you have an idea how to do this if multiple sqls can be used?
Winston Liek wrote:In my example, is this correct:
SQL 1:
UPDATE Table1 tbl1
JOIN Table2 tbl2 ON tbl1.ID = tbl2.ID
SET tbl1 .age = tbl2.age
WHERE tbl1 .age is NULL
SQL2:
UPDATE Table1 tbl1
JOIN Table2 tbl2 ON tbl1.name= tbl2.name
SET tbl1.age = tbl2.age
WHERE tbl1.age is NULL