Syntax:
create table newtable ( select * from existingtable)
Example -1 : Creating an exact copy if an existing table including data.
mysql> create table newaddressbook ( select * from oldaddressbook);
Example -2 : Creating a new table with same table structure of an existing table (columns) but without data.
mysql> create table newaddressbook ( select * from oldaddressbook limit 0);
No comments:
Post a Comment