Is there a way to use a MySQL INSERT
similar to the following:
INSERT INTO doc_details SELECT * FROM doc_details WHERE dd_id = 1
This doesn't work because the primary key is being repeated and it can get very long-winded expanding the columns out.
The purpose of this is to duplicate rows in the same table which will get modified later, retrieving the last_insert_id
for the new record. So ideas for other ways to do this would be appreciated too.
Thanks.