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 does do in mysql?
What is required to create mysql database?
What is max connection in mysql?
What is bigint in mysql?
Can we store images in mysql database?
What is mysql and why it is used?
How do I setup a mysql database?
What port is mysql running on?
What is the latest version of mysql?
How do you rename a table in mysql?
How to store values to array from mysql database in php?
How do I run a query in mysql?
What could be the reason that the mysql statement 'select avg (salary) from emp' generates an inaccurate output?
What you can use regular expression for in mysql?
How to delete a trigger in mysql?