Hope some one can help me, I would like to copy rows in same table and that table has relation to another table that I have to copy related row accordingly:
Table1
table1Id table0Id otherColumn
1 3 8
2 3 9
3 4 6
I copied rows with table0Id = 3
Table1
table1Id table0Id otherColumn
1 3 8
2 3 9
3 4 6
-------------------------
4 3 8
5 3 9
I would like to do the same to Table2 depending to the Table1 Ids like this:
Table2
table2Id table1Id otherColomn
1 1 0
2 2 5
3 3 8
Table2
table2Id table1Id otherColomn
1 1 0
2 2 5
3 3 8
-----------------------
4 4 new Id 0
5 5 new Id 5
As you see row 1 and 2 are copied in table2 but they have new Ids from newly added rows in table1. I know how to do the firs part but I'm stuck at the second part.