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

How many columns can a mysql table have?

879


how we will Show selected records sorted in an ascending (asc) or descending (desc).

967


What is database in php mysql?

975


Is sql and mysql same?

900


How does mysql store data?

918


What is horizontally scalable?

958


What is mysql gpl?

827


How to display top 50 rows?

1041


Explain the difference between mysql_fetch_array(), mysql_fetch_object()?

924


Is oracle better than mysql?

865


Can't connect mysql server on localhost?

1046


What is difference between unix timestamp and mysql timestamp?

991


How to determine the location of the data directory?

940


What is a crosstab query?

936


What is the difference between truncate and delete?

1164