Mysql – Update Table 1 taking value from table 2

MySQL

I want to update Table 1 by taking the value from Table 2. Both the tables have Emp No which is a key. I want to update the Salary column in Table 1 with the value that is present in Table 2

UPDATE TEST.tbl1  --< first the table that will be updated
JOIN   TEST.tbl2
ON     tbl1.IDNo = tbl2.IDNo
SET    Salary = Salary (From Second Table)

When i tried this iam getting an Error.. It says Error at or before the TEST..

Please anyone help me

Best Answer

UPDATE tbl1, tbl2
SET tbl1.Salary = tbl2.Salary
WHERE tbl1.IDNo = tbl2.IDNo