在Oracle中的树形操作
在Oracle中的树形操作
1.取子节点及路径(正树):
select t.id ,t.code, t.name ,t.pid
,SYS_CONNECT_BY_PATH(t.id,'.')||'.' as IdPath
from tas_catalog t
--where id!=110
start with id=110
connect by pid = prior id
order siblings by id
2.取各级父节点(倒树):
select t.id ,t.code, t.name ,t.pid
,SYS_CONNECT_BY_PATH(t.id,'.')||'.' as IdPath --路径从反的
from tas_catalog t
--where id!=110
start with id=110
connect by id = prior pid
order siblings by id
无论正树还是倒树, 关键就在于connect by的条件.
正树: 必须是 ‘父’= prior ‘子’
倒树: 必须是 ‘子’= prior ‘父’
相关文档:
----------------------------------------------------------------------------
相关知识:Oracle SYNONYM(同义词)
----------------------------------------------------------------------------
是一种映射关系,可以理解为表的一种固定别名
同义词的好处:建立一个同义词可以排除一个对象名字的限制
如果你的 ......
3月6日:
九、表管理:
一、再表管理中需要学习的内容:
1、 创建表
2、 常用的数据类型
3、 删除表
4、 复制表
5、 修改表
6、 表重命名
7、 截断表
8、 表的约束条件
二、创建表
常见表语法:
创建表语法:
CREATE TABLE 表名
(
&nb ......
Oracle 的管理可以通过OEM或者命令行接口。 Oracle Clusterware的命令集可以分为以下4种:
节点层:osnodes
网络层:oifcfg
集群层:crsctl, ocrcheck,ocrdump,ocrconfig
应用层:srvctl,onsctl,crs_stat
下面分别来介绍这些命令。
一. 节点层
只有一个命令: osnodes, 这 ......
1z0-047 资料的最新分享,下面一些题目是从最新的题库中精心整理出来的,质量很高,需要的朋友看过来的啊。
1. Which statements are true? (Choose all that apply.)
A. The data dictionary is created and maintained by the database administrator.
B. The data dictionary views can consist of joins of dictiona ......