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 are the functions of commit and rollback statements?

1099


What is default password for mysql?

909


How to drop an existing table in mysql?

1057


What are all the Common SQL Function?

1207


How to analyze tables with 'mysqlcheck'?

1262


Can we store images in mysql database?

946


What is the function of mysqldump?

1122


What is index length in mysql?

984


What is the latest version of php and mysql?

1268


How to convert character strings to numeric values?

1174


Is oracle better than mysql?

937


What is InnoDB?

1156


How to get data from mysql in php?

948


Is mariadb faster than mysql?

1005


How do I assign a variable in mysql?

1050