关于oracle:oracle函数表复制CT和IS

4次阅读

共计 396 个字符,预计需要花费 1 分钟才能阅读完成。

CT 和 IS(表复制)

1、CT(create table … as)

  • 语法

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

    <br/>

  • 案例

    查问 emp 表中 deptno 为 10 的数据,创立 表 emp10(创立出 emp10 表

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

<br/><br/>

2、IS(insert into …select..)

  • 语法

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

<br/>

  • 案例

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

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

    <br/><br/>

正文完
 0