發(fā)布時(shí)間:2021-06-05
欄目:其他
select connect_by_root last_name root_last_name無(wú)限層次樹形筆記本 , connect_by_root id root_id,
id,last_name,manager_id
from s_emp
無(wú)限層次樹形筆記本start with manager_id is null
connect by prior id=manager_id;
結(jié)果為:
3.5 使用SIBLINGS關(guān)鍵字排序
前面說了,對(duì)于層次查詢?nèi)绻胦rder by排序,比如order by last_name則是先做完層次獲得level,然后按last_name 排序,這樣破壞了層次,比如特別關(guān)注某行的深度,按level排序,也是會(huì)破壞層次的。
在oracle10g中,增加了siblings 關(guān)鍵字的排序。
語(yǔ)法:order siblings by
它會(huì)保護(hù)層次,并且在每個(gè)等級(jí)中按expre排序無(wú)限層次樹形筆記本。
select level,
id,last_name,manager_id
from s_emp
start with manager_id is null
無(wú)限層次樹形筆記本connect by prior id=manager_id
order siblings by last_name;
如果您覺得 Oracle10g新增connect_by_root,用在列名之前表示此行的根節(jié)點(diǎn)的相同列名的值 這篇文章對(duì)您有用,請(qǐng)分享給您的好友,謝謝
文章地址:http://www.brucezhang.com/article/other/Oraclegxzconnect_by_root,yzlmzqbscxd.html
文章地址:http://www.brucezhang.com/article/other/Oraclegxzconnect_by_root,yzlmzqbscxd.html

分類列表
換一批
精品推薦
SEO軟件排行榜
推薦文章
- 1通王CMS 2.0簡(jiǎn)介
- 2黑帽網(wǎng)站排名檢測(cè)
- 3MySQL中經(jīng)典的too many connection怎么破
- 4網(wǎng)易郵箱洪陸駕:反垃圾郵件需集合全球力量
- 5站群友鏈換鏈神器
- 6云勢(shì)軟件VirgoEDC助力安徽萬(wàn)邦、迪時(shí)咨詢等公司臨床試驗(yàn)數(shù)據(jù)采集智能化
- 7Authorize 屬性通過聲明的方式保護(hù)控制器或其部分方法
- 8域名是稀有資源,好的域名,在一定時(shí)期內(nèi)會(huì)越來(lái)越升值
- 9解析常見的PHP緩存技術(shù)有哪些
- 10對(duì)ASP.NET程序員非常有用工具