ORACLE查询树型关系(connect by prior start with)
来源:互联网 发布:安卓windows模拟器 编辑:程序博客网 时间:2024/05/17 03:42
参考http://hi.baidu.com/suofang/blog/item/a58bdd5829d5e583800a1812.html
ORACLE查询树型关系(connect by prior start with)
有如下表结构:
create table TVideoSort
(
FsysId NVARCHAR2(32 char) not null,
FSortName NVARCHAR2(32 char),
FSortTopId NVARCHAR2(32 char),
FSortAddress number,
FSortIsList char(1),
constraint PK_TVIDEOSORT primary key (FsysId)
);
数据如下:
--子查父(通过子节点向根节点追朔.)
查询〔特下边〕的父节点
select FsysId,FSortName,FSortTopId,FSortAddress,FSortIsList from TVideoSort
start with FsysId='3703E5CD81E48D6BE
connect by prior FSortTopId=FsysId
order by FsortAddress
结果
――父查子(通过根节点遍历子节点.)
查询〔特下边〕的子节点:结果
select FsysId,FSortName,FSortTopId,FSortAddress,FSortIsList
from TVideoSort start with FsysId='3703E5CD81E48D6BE
connect by prior FsysId=FSortTopId order by FsortAddress
查询〔特长练习〕的子节点:结果
select FsysId,FSortName,FSortTopId,FSortAddress,FSortIsList
from TVideoSort start with FsysId='36AE4D68EC7D364CE
connect by prior FsysId=FSortTopId order by FsortAddress
特别注意,两个查询只是FsysId=FSortTopId不同而已,即子查父则把FSortTopId做为主表放前面,父查子则把FsysId放前面作主表
- ORACLE查询树型关系(connect by prior start with)
- ORACLE查询树型关系(connect by prior start with) .
- ORACLE查询树型关系(connect by prior start with)
- ORACLE查询树型关系(connect by prior start with)
- ORACLE查询树型关系(connect by prior start with)
- ORACLE查询树型关系(start with connect by prior)
- ORACLE查询树型关系(connect by prior start with)
- 【转】ORACLE查询树型关系(start with connect by prior)
- ORACLE查询树型关系(connect by prior start with)
- ORACLE查询树型关系(start with connect by prior)
- Oracle查询树型关系(start with connect by prior)
- oracle树结构查询(start with connect by prior )
- ORACLE树查询,start with connect by prior
- ORACLE树查询,start with ... connect by prior ...
- ORACLE树查询,start with connect by prior
- Oracle实现树查询:select ... start with ... connect by prior
- Oracle 遍历树 start with () connect by prior ()
- oracle树操作(select .. start with .. connect by .. prior)
- idsoftware ID TECH5 megatexture实现方案
- ADO.NET基础教程(1)
- FAQ_解决Virtual PC装redhat linux出现花屏的问题
- 视频格式参数解析
- Makefile 规则
- ORACLE查询树型关系(connect by prior start with)
- 《JavaScript权威指南》读书笔记
- 基于VC的串行通信技术应用实例
- 8-16手记
- 公司间调web service接口经验
- 2007年第32周CSDN读书排行榜:《Joel谈优秀软件开发方法》第一
- ASP.NET配置文件Web.config 详细解释
- 图像
- 有关乱码的处理