【oracle】-函数:表复制(CT和IS)...

CT和IS(表复制)

1、CT(create table ... as)

  • 语法

    create table <new table> as select * from <exists table>
    

  • 案例

    查询emp表中deptno为10的数据,创建表emp10 (创建出emp10表

    create table emp10 as select * from emp where deptno=10; 
    



2、IS (insert into ...select..)

  • 语法

    insert into table2(f1,f2...) select v1,v2....from table1 
    

  • 案例

    查询emp表中deptno为50的数据,插入到emp10表中(emp10已存在

    insert into  emp10(empno,ename,job) select empno,ename,job  from emp where deptno=50;
    



原文地址:https://www.cnblogs.com/mercurytan/p/13519864.html