MySQL: Make a copy of an existing table in MySQL

We can create a copy of an existing table using the following SQL statements.
 CREATE TABLE booger_copy LIKE testing.booger;  
 INSERT booger_copy SELECT * FROM testing.booger;  
If you want to copy only half of the existing table then, you can use LIMIT keyword in the select Query

No comments:

Post a Comment

Python contextlib for Timing Python code

If you've ever found yourself needing to measure the execution time of specific portions of your Python code, the `contextlib` module o...