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


About admin

Check Also

Best Payment Methods / APIs to integrate with applications

Paypal Stripe BrainTree 2checkout

Leave a Reply

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