insert into table select * from table where primarykey=1
I just wanna copy one row to insert into the same table, but i don't want list all the columns after the "select",cause this table has too many columns.
But when i do this, i get the error: "Duplicate entry 'xxx' for key 1"
I can handle this by creating another table with same columns as the temporary container for the record i want to copy:
create table oldtable_temp like oldtable;
insert into oldtable_temp select * from oldtable where key=1;
update oldtable_tem set key=2;
insert into oldtable select * from oldtable where key=2;
Can there be some more way to solve this more simply?