1. 程式人生 > >mysql資料庫-----從一個表中複製資料和結構到另一個表中

mysql資料庫-----從一個表中複製資料和結構到另一個表中

一.從一個表複製結構到另一個表

create table t_emp select * from emp where 1=2;

emp表


t_emp表----只複製了emp表的結構


二.從一個表複製結構和資料到另一個

create table t_emp select * from emp where 1=1;


三.跨表插入

insert  into t_emp select * from emp