.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.
Copyright © 2019- fupindai.com 版权所有 赣ICP备2024042792号-2
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务