select [level],column,expr from table [where condition]
[start with]起点(自底向上/自顶向下)
[connect by prior + 主键/外键=外键/主键]//看你往哪个方向查
自顶向下 左边放主键,右边放外键
select employee_id,last_name,salary,job_id,manager_id
from employees
start with manager_id is null
connect by prior employee_id=manager_id;
自底向上 右边放主键,左边放外键
level(伪列)
层次的级别:不固定值。
使用 level 和 lpad 层次化格式的显示
修剪分支
oracle 9i 对dml和ddl语句的扩展
多表插入的 insert 语句
insert .... select 语句可以被用来在单个dml语句中向多个表插入数据。
多表插入语句:
无条件insert
条件 all insert
条件 first insert
轮巡 insert