MySQL: How to duplicate a row using SQL ?

Use following SQL query to duplicate any single row. Use your own field names to make this working in your case.

insert into packages (`field_1`, `field_2`, `field_3`, `field_4`) 
select `field_1`, `field_2`, `field_3`, `field_4` from packages where id=1

 

Leave a Reply

Your email address will not be published. Required fields are marked *