Oracle 查询树形所有节点名称
Oracle查询多级树形结点所有名称:
比如:上海下有浦东新区下有周浦,要查广东*广州*天河区 sql如下:
select u.*
from (select a.auto_id,
substr(SYS_CONNECT_BY_PATH(a.area_name, '*'), 2) area_name //此处以*号分割名称
from t_sys_area a
where 1 = 1
start with a.pid in (select pid
from t_sys_area
where 1 = 1
and a.pid = '1')
connect by prior a.auto_id = a.pid) u
相关推荐
lklong 2020-11-22
oraclemch 2020-11-06
shilukun 2020-10-10
周嘉笙 2020-11-09
iilegend 2020-10-19
EricRay 2020-10-16
zhuzhufxz 2020-09-16
dataminer 2020-08-17
bfcady 2020-08-16
Hody 2020-08-16
FightFourEggs 2020-08-16
数据库设计 2020-08-16
Seandba 2020-08-16
Omega 2020-08-16
zjyzz 2020-08-16
yanghuatong 2020-08-16
ktyl000 2020-08-16
dbasunny 2020-08-16