To copy a row and insert it into the same table in MySQL with an auto-increment field, you can use an INSERT INTO. SELECT statement. This lets you insert all the data from the source row while automatically generating a new value for the auto-increment column.
Example
Suppose we have a table named my_table with columns id (auto-increment), name, and value:
INSERT INTO my_table (name, value)
SELECT name, value
FROM my_table
WHERE id = 1;
Explanation
Specify the Columns: Just list which columns you wish to select and copy except 'id' since it contains the auto-increment specification.
SELECT Clause: Here, it fetched the values from the same row which was identified.
INSERT Clause: This created a new row and is able to let MySQL specify the id.