How we can copy one table data into another table whose name
same as table but in differ database
Answer Posted / saket bharti
create table database2.tablename as (select * from
database1.tablename where 1=2);
This will create a new table in database2 with the same
structure as the table in database1 ,but will not contain
any values or constraints of database1 table.
create table database2.tablename as (select * from
database1.tablename );
This will create a new table in database2 with all the
structure and values from the table from database1.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
How many columns can a mysql table have?
how we will Show selected records sorted in an ascending (asc) or descending (desc).
What is database in php mysql?
Is sql and mysql same?
How does mysql store data?
What is horizontally scalable?
What is mysql gpl?
How to display top 50 rows?
Explain the difference between mysql_fetch_array(), mysql_fetch_object()?
Is oracle better than mysql?
Can't connect mysql server on localhost?
What is difference between unix timestamp and mysql timestamp?
How to determine the location of the data directory?
What is a crosstab query?
What is the difference between truncate and delete?