Manipulating Data 数据操作
you should be able to: 1、Specify explicit default values in the INSERT and UPDATE statements 2、Describe the features of multitable INSERTs 3、Use the following types of multitable INSERTs: 4、Unconditional INSERT 5、Conditional INSERT ALL 6、Conditional INSERT FIRST 7、Pivoting INSERT 8、Merge rows in a table 9、Perform flashback operations 10、Track the changes made to data over a period of time
default 值 1、default with insert: INSERT INTO deptm3 (department_id,department_name,manager_id) VALUES (300,‘Engineering‘,DEFAULT);
2、default with update UPDATE deptm3 SET manager_id = DEFAULT WHERE department_id = 10;
multitable insert statements INSERT…SELECT...
INSERT ALL INTO target_a VALUES(…,…,…) INTO target_b VALUES(…,…) INTO target_c VALUES(…,…) SELECT … FROM sourcetab WHERE …;
Unconditional INSERT ALL 无条件全插入 例: create table sal_history as select employee_id,hire_date,salary from emp where 1=0;
create table mgr_history as select employee_id,manager_id,hire_date from emp where 1=0;
INSERT ALL INTO sal_history VALUES(EMPID,HIREDATE,SAL)INTO mgr_history VALUES(EMPID,MGR,SAL)SELECT employee_id EMPID,hire_date HIREDATE,salary SAL,manager_id MGR FROM employeesWHERE employee_id > 200;
(编辑:李大同)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|