Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 pdo :: fetch_assoc?

904


Is primary key auto increment?

946


Which statement is used in a select query for partial matching?

1189


How can you add and remove any column of a table?

944


What is mysql url?

866


Explain the difference between procedure and function in mysql?

992


Can mysql and mariadb coexist?

1093


What are the advantages and disadvantages of using mysql?

1001


What is prepared statement in mysql?

971


Is pdo more secure than mysqli?

882


can you tell the order of sql select statement? : Mysql dba

914


What, if a table has one column defined as TIMESTAMP?

1013


What is indexing in mysql?

965


What is the maximum size of table in mysql?

1029


What is the password of mysql?

965