0

table1

name | value | age
--------------------
ram  | 10    | 12
ram  | 10    | 13
ram  | 12    | 14
peter| 12    | 13
peter| 14    | 15

table2

name | value | place
---------------------
john | 12    | chen
ram  | 10    | mad
peter| 12    | chen

So i want update table2 by recently added value from table 1 table2 have ram 10 ,peter 12. table1 recently added ram 12 and peter 14 so i want that update, thank you

unutbu
  • 842,883
  • 184
  • 1,785
  • 1,677
  • 1
    Look at the [multi-table update syntax](https://dev.mysql.com/doc/refman/5.7/en/update.html) and make an attempt. – danblack Feb 27 '19 at 20:04
  • Join with a query that finds the most recent line in each group. See https://stackoverflow.com/questions/7745609/sql-select-only-rows-with-max-value-on-a-column?rq=1 – Barmar Feb 27 '19 at 20:44

0 Answers0