0

I want to updated value in database column. Column value update database1. So database 1 and database 2 compare and database 1 update new value.

Sample data:

  • Table 1: column names ID AND BranchName
  • Table 2: column names ID AND BranchName

Table 1:

 ID      BranchName
---------------------
 01      Doctor
 02      Teacher

Table 2:

ID      BranchName
--------------------
01      Dentist
02      Teacher

New sample data:

ID      BranchName
--------------------
01      Dentist
02      Teacher

How to write change new value query?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

0
                UPDATE Database1
                SET Database1.BranchName = Database2.BranchName,
                FROM Database1 JOIN Database2 
                ON Database1.id = Database2.id

Try this,Hope this help you

YC1207
  • 54
  • 3
  • Product specific answer to a question with no dbms specified. At least tell us which dbms this is for. – jarlh Aug 15 '18 at 07:27