Umang Tandon

Umang Tandon

  • 1.9k
  • 100
  • 306

Data copy from 1 table to another with the foreign key

Jun 5 2019 11:33 AM
I have an issue in insertion of records from one table to another the tables schema is same
 
Table 1
 
Id       Parent Id       Text
11          Null              A
12          Null              B
13          11                 C
14          11                 D
15          13                 E
 
The record should be inserted in this format, According to my knowledge I have to copy the foreign key relation not the identities of it.
 
Table 2
 
Id       Parent Id       Text
31          Null             A
32          Null             B
33          31                C
34          31                D
35          33                E

Brought to you by:

Answers (7)