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


Please Help Members By Posting Answers For Below Questions

What is dblink?

559


What is datatype in mysql?

552


What is mysql and why it is used?

642


What is mysql and mysqli?

539


What is the maximum no of columns a table can have?

549






How to use rank function in mysql?

566


What are the difference between now and current_date in mysql?

781


How do I restore a database in mysql workbench?

574


what is the difference between gui testing and database testing? : Mysql dba

585


What is a text delimiter?

590


Is mysql good for big data?

574


What is a csv table?

628


How to Join tables on common columns.

716


What is blob in mysql?

584


What is int mysql?

581