I have an oracle SQL table whose rows I’d like to duplicate, while incrementing the id for each row and change the value of 2 columns. So the pseudo code would go so something like this:
for each row r in TABLE t
new n = r
n.id = r.id+1
n.columnA = 12
n.columnB = 13
insert n into t
Can someone show how I would do this in Oracle SQL?
1 Answer