Sql updating a table from another table

by  |  07-Jul-2018 10:56

sql updating a table from another table-4sql updating a table from another table-8

I guess it is difficult for you to state your problem in English clearly enough, bit don't despair! Post some 5-10 rows from each table, explain what should become what, and that may just be enough for us to understand what you are trying to accomplish. I've done this before using subqueries, but I knew there had to be a simpler way. Plus the answer already has an accepted answer which works.

I just want to add that I only wanted to update a subset of the records in one table based on corresponding values in another table, which can easily be done by adding a condition to the WHERE clause, e.g.

2) in this way, if I want join 2table and some columns in table #2 does not exist in table #1 I got any error?

for example if I have color column in table #2 and its not exist on table #1, join process got error or just join columns exist in 2tables?

So I need to update the table in the new DB from the table in the old DB which has around 1000 rows.

Community Discussion