I have an adjacent list hierarchy model that makes up a topic structure
ID Parent_Id Topic_Name
1 Null Topic 1
2 Null Topic 2
3 2 Topic 3
4 3 Topic 4
5 2 Topic 5
6 Null Topic 6
I want to specify a topic id and then copy it to a new topic id at a certain position and retain the levels / structure underneath
So in my example I could specify topic topic_id 2 with pos_id 1 and it would create
ID Parent_Id Topic_Name
1 Null Topic 1
7 Null Topic 2
8 7 Topic 3
9 8 Topic 4
10 7 Topic 5
2 Null Topic 2
3 2 Topic 3
4 3 Topic 4
5 2 Topic 5
6 Null Topic 6
topic_id being the node to copy and pos_id is the node to insert the copy after
Auto numbering is on for the ID, but I can't guarantee that subnodes will always be the next id number up from the parent.
topic_id being the node to copy and pos_id is the node to insert the copy after