I need to duplicate a row multiple times in the same table.
I have a table like this
I want to duplicate the second row multiple times but with increment to ID.
How do I achieve this?
Thanks a lot in advance!
I need to duplicate a row multiple times in the same table.
I have a table like this
I want to duplicate the second row multiple times but with increment to ID.
How do I achieve this?
Thanks a lot in advance!
Add 'auto_increment' in property for id and:
INSERT INTO
table_name (user_id, value, time, category)
SELECT
user_id, value, time, category
FROM
table_name
WHERE
id = 330;
if need modification table:
ALTER TABLE table_name MODIFY id INT AUTO_INCREMENT PRIMARY KEY