您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

Oracle 层级语句 树形结构 显示根节点 不显示根节点

2024/6/4 22:54:07发布25次查看
.oracle 层级语句 树形结构 area_id 就是普通的主键id 与parent_id 对应..行政区划表 1.start with t.parent_id 这里为parent_id 不显示顶端根结点,这样会有多个根 select t.* from hm_f_area t where length(t.area_id) = 6 start with t.parent_id = '5100
.oracle 层级语句 树形结构
area_id 就是普通的主键id  与 parent_id 对应..行政区划表
1.  start with t.parent_id 这里为parent_id 不显示顶端根结点,这样会有多个根
select t.* from hm_f_area t where length(t.area_id) = 6 start with t.parent_id = '510000' connect by t.parent_id = prior t.area_id
2.start with t.id 如果为id 就是显示根,只有一个根
select t.* from hm_f_area t where length(t.area_id) = 6 start with t.area_id = '510000' connect by t.parent_id = prior t.area_id
.
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product