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 are the functions of commit and rollback statements?
What is default password for mysql?
How to drop an existing table in mysql?
What are all the Common SQL Function?
How to analyze tables with 'mysqlcheck'?
Can we store images in mysql database?
What is the function of mysqldump?
What is index length in mysql?
What is the latest version of php and mysql?
How to convert character strings to numeric values?
Is oracle better than mysql?
What is InnoDB?
How to get data from mysql in php?
Is mariadb faster than mysql?
How do I assign a variable in mysql?