To make a copy of a table in MySQL you need to execute the following statement:
use databasename;
Create table new_table_name
select * from existing_table_name
where conditions
For example:
We have database demo having table1. We required to create a table that is the copy of table1 and named it as table2. Following are statement you need to execute:
use demo;
Create table table1
select * from table2
Suppose you need the copy of the data based on some conditions:
use demo;
Create table table1
select * from table2
where colname='value';
0 Comment(s)