insert into table select * from table where primarykey=1
I just want to copy one row to insert into the same table (i.e., I want to duplicate an ex
I might be late in this, but I have a similar solution which has worked for me.
INSERT INTO `orders` SELECT MAX(`order_id`)+1,`container_id`, `order_date`, `receive_date`, `timestamp` FROM `orders` WHERE `order_id` = 1
This way I don't need to create a temporary table and etc. As the row is copied in the same table the Max(PK)+1 function can be used easily.
I came looking for the solution of this question (had forgotten the syntax) and I ended up making my own query. Funny how things work out some times.
Regards