Reputation: 53
In MySQL, I am trying to copy a row in the same table and also increment the primary key and further update a column at the same time.
For example:
1 | Test1 | VALUE1 |
2 | Test1 | VALUE2 |
NOTE: I was able to figure out to copy a record and insert it as a new record but I cannot figure out how to update the data at the same time.
UPDATE: I am using something like this:
Insert into table(col1, col2)
select c1, c2
from table
where id = 1
Upvotes: 3
Views: 2257