17,082
社区成员
发帖
与我相关
我的任务
分享
SQL> create table t_dept as
2 select * from dept;
Table created
SQL> select * from t_dept;
/*
DEPTNO DNAME LOC
------ -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
*/
SQL> select * from dept;
DEPTNO DNAME LOC
------ -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
SQL> desc dept;
Name Type Nullable Default Comments
------ ------------ -------- ------- --------
DEPTNO NUMBER(2)
DNAME VARCHAR2(14) Y
LOC VARCHAR2(13) Y
SQL> create table t_dept(
2 deptno number(2),
3 dname varchar2(14),
4 loc varchar2(13)
5 );
Table created
SQL> insert into t_dept(deptno,dname,loc)
2 select deptno,dname,loc from dept;
4 rows inserted
SQL> select * from t_dept;
DEPTNO DNAME LOC
------ -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON