Is there a way to copy rows in MySQL? I need to copy the same data 15 times and would rather not type it in. The only thing I need changed is the ID which is set to auto-increment.
Copying Rows
Started by Void, Apr 08 2007 11:11 AM
6 replies to this topic
#1
Posted 08 April 2007 - 11:11 AM
Void
|
|
|
#2
Posted 09 April 2007 - 08:43 AM
I would use the Insert command from SQL 15 times, specifying everything except the ID.
#3
Guest_Jordan_*
Posted 09 April 2007 - 12:27 PM
Guest_Jordan_*
WingedPanther said:
I would use the Insert command from SQL 15 times, specifying everything except the ID.
After looking through the commands I couldn't find anything so I would have to suggest what WingedPanther said as well.
#4
Posted 02 September 2007 - 09:31 AM
Couldn't this be possibly done using a sub query?
INSERT INTO employees3 (id,Lastname,Firstname,Title) (SELECT id,Lastname,Firstname,Title FROM employees WHERE Title='manager');
Something like the above. I know that Subquerys have just recently be supported fully in MySQL
;-)
INSERT INTO employees3 (id,Lastname,Firstname,Title) (SELECT id,Lastname,Firstname,Title FROM employees WHERE Title='manager');
Something like the above. I know that Subquerys have just recently be supported fully in MySQL
;-)
#5
Guest_Jordan_*
Posted 03 September 2007 - 06:40 AM
Guest_Jordan_*
It might be possible for this to work. It would be interesting to know if it did work.
#6
Posted 03 September 2007 - 03:39 PM
yep it worked. I did a little test and it worked
#7
Posted 10 October 2007 - 10:29 AM
Yeah I also used this command and it's working very efficiently. That is really a great work. I would like to appreciate all the effort drawn by members of this forum.
Cheers.
Cheers.


Sign In
Create Account


Back to top









