Maybe this seems like the opposite of what people would normally like to do, but I'd like to duplicate rows in my mysql table.
So, for example, I have a table with 1 row that has project_id, and one row with file_name. Each project has very many files associated with it. I would like to duplicate all rows that exist for one project in to another project. I could write some python script that would do this but I suspect there would be a way to do it from within mysql.
Any ideas? Thanks.
For example, if I have a project that looks like this...
file_id, file_name, project_id
-------, ---------, ----------
1, file1.png, 1
2, file2.png, 1
3, file3.png, 1
...and up to around 100 rows.
What should I type in to get a project that looks like this...
file_id, file_name, project_id
-------, ---------, ----------
1, file1.png, 1
2, file2.png, 1
3, file3.png, 1
4, file1.png, 2
5, file2.png, 2
6, file3.png, 2