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
Which storage engine is best in mysql?
What is meant by decimal (5,2)?
How do I create a schema in mysql?
How to execute mysql query in php?
Who owns mysql database?
How internally data stores in MyISAM and INNODB table types?
What is heap table?
What is normalization and list the different types of normalization?
How to use triggers to track changes in mysql?
How to Join tables on common columns.
What is the difference between sql and mysql and oracle?
How can you change the name of any existing table by using the sql statement?
what is cte? : Mysql dba
Can you tell the reasons for selecting lamp(linux, apache, mysql, php) instead of any other combination of software programs, servers, and operating system?
What command is used to delete the data from the table without deleting the table structure?