Q:

MYSQL - update a table from another with composite primary key

I have an unusual situation where I have to update a table with the values from another, the two tables are identical.
Table 1 and Table 2
+-------------+----------+------+-----+---------+-------+
| Field       | Type     | Null | Key | Default | Extra |
+-------------+----------+------+-----+---------+-------+
| timeStamp   | datetime | NO   | PRI | NULL    |       |
| obj_id      | int(10)  | NO   | PRI | NULL    |       |
| value       | double   | YES  |     | NULL    |       |
+-------------+----------+------+-----+---------+-------+

And I need to update table1 with the values stored in table2.
I've tried with some useful piece of information found here on SO...
after several try i've come up with a query of this sort:
UPDATE table1 AS f  
    SET table1.value = t.value 
FROM table2 AS t 
WHERE (f.timeStamp, f.obj_id) = (t.timeStamp,t.obj_id);

ofc with no luck till now :(
the error is the most common one:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM table2 AS t WHERE (f.timeStamp, f.obj_id) = (t.timeStamp,t.obj_id)' at line 1

A:

I first write a SELECT statement, that shows the existing values to be replaced, along with the new values. This lets me test expressions, and visually verify the results e.g.
 SELECT t.obj_id
      , t.timestamp 
      , t.value      AS old_value
      , s.value      AS new_value
   FROM table1 s
   JOIN table2 t 
     ON t.timestamp = s.timestamp
    AND t.obj_id    = s.obj_id
  WHERE NOT ( t.value <=> s.value )

(I typically use t as the alias for the table that is going to be the "target" of the update, and use s as the alias for the "source".)
Then I convert that it into an UPDATE statement by replacing  "SELECT ... FROM" with the "UPDATE" keyword, and adding a "SET" clause before the "WHERE" clause  
 UPDATE table1 s
   JOIN table2 t 
     ON t.timestamp = s.timestamp
    AND t.obj_id    = s.obj_id
    SET t.value = s.value
  WHERE NOT ( t.value <=> s.value )

