語法code
create table <new table> as select * from <exists table>
<br/>table
案例select
查詢emp表中deptno爲10的數據,建立表emp10 (建立出emp10表)語法
create table emp10 as select * from emp where deptno=10;
<br/><br/>數據
語法查詢
insert into table2(f1,f2...) select v1,v2....from table1
<br/>tab
案例co
查詢emp表中deptno爲50的數據,插入到emp10表中(emp10已存在)new
insert into emp10(empno,ename,job) select empno,ename,job from emp where deptno=50;
<br/><br/>ab