0

I have 2 Tables: Table A and Table B

Table A has below columns: ID, Name, Address, Mobile_No, DOB ID column in table A is already populated. Rest of the columns are blank.

Table B has below columns: ID, Name, Address, Roll_Number

Table C has below columns: Roll_Number, Mobile_no, DOB

I want to write SQl query to populate Name & Address (from table B) Mobile_no and DOB from Table C corresponding to the ID in Table A.

I tried using the Insert query, but it inserts a new record rather then updating the existing record. I also used the merge into and Update query, but still it enters new record.

Can someone please provide me with a query to sort this issue?

Barmar
  • 741,623
  • 53
  • 500
  • 612
  • `INSERT` is for creating a new record, `UPDATE` is for updating existing records. Use `UPDATE` with `JOIN` to update based on related rows in another table. – Barmar Apr 26 '18 at 18:10
  • Hi Barmar, are you the owner of stackoverflow? if yes, request you to block my account. If no.. request you to shut your mouth if you cant help me.. I already tried a lot of googling but cannot paste the code as it involves confidential information. So mind your own business and if you are not free, don't comment.. –  Apr 27 '18 at 08:42

0 Answers0