2

How to duplicate hierarchical data to insert them at the same table, generating new Ids but keeping parent-child relationship

4

1 回答 1

0

重新插入数据,但将相同的大数字添加到每个 ID。


更新:

如果我正确理解你的问题,你想复制这样的数据:

EMPLOYEE_ID    MANAGER_ID
1              <null>
2              1
3              1
4              3

在这种情况下,只需向每个父 ID 和子 ID 添加 4 即可创建新行,但具有相同的关系:

EMPLOYEE_ID    MANAGER_ID
5              <null>
6              5
7              5
8              8
于 2011-09-22T22:21:51.513 回答