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
What is pdo :: fetch_assoc?
Is primary key auto increment?
Which statement is used in a select query for partial matching?
How can you add and remove any column of a table?
What is mysql url?
Explain the difference between procedure and function in mysql?
Can mysql and mariadb coexist?
What are the advantages and disadvantages of using mysql?
What is prepared statement in mysql?
Is pdo more secure than mysqli?
can you tell the order of sql select statement? : Mysql dba
What, if a table has one column defined as TIMESTAMP?
What is indexing in mysql?
What is the maximum size of table in mysql?
What is the password of mysql?