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
Is mysql good for big data?
What is prepare statement in mysql?
Which is faster mongodb or mysql?
What is the difference between sql and mysql and oracle?
How to get a list of all tables in a database?
What happens when the column is set to AUTO INCREMENT and if you reach maximum value in the table?
Is mysql free software?
What is a trigger in mysql?
What are procedures in mysql? Explain
What is memory table in mysql?
what is the difference between gui testing and database testing? : Mysql dba
State the differences between mongodb and mysql.
Is mysql still relevant?
What is the difference between truncate and delete in mysql?
What is the function of myisamchk?