3 Replies Latest reply on Oct 8, 2015 11:11 AM by kulikouski

    Updating fields in a table with values from other table


      Hi..!!! I need help..!


      I would like to make an update in a table based on data from another table:

      - I have a "T2" table that has the same fields as another table "T1".

      - I want to update the values of certain fields in the table T1 with the values of these same fields in the table T2


      Query I do the following query to be sure I'm reading the correct data:

      SELECT T1.field1, T2.field1, T1.field2, T2.field2 FROM table1 T1, table2 T2 WHERE T1.field1=T2.field1 AND T1.field2=T2.field2

      Now, I would like to do the UPDATE as follows:

      UPDATE table1 SET T1.field1=T2.field1, T1.field2=T2.field2


      That is, Field1 & Field2 fields of all records in the table T1 should have the same value as the same field in table T2.

      I don't know how to finish the sentence. How must I make the WHERE part??


      Thanks a lot..!!!