oracle樹形選單查詢

livedba發表於2012-03-15

oracle樹形選單查詢

參考http://space.itpub.net/10159839/viewspace-584603

[@more@]select * from(
select t.function_id,lpad(t.function_name,length(t.function_name)*2+(level-1)*2,'->'),t.function_name,t.parent_id,t.order_,t.fun_state,t.function_type,level from base_function t START WITH t.function_id in(0)
CONNECT BY PRIOR t.function_id=t.parent_id
order siblings by t.order_) tt
where tt.fun_state=1 and tt.function_type=1

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25261409/viewspace-1057600/,如需轉載,請註明出處,否則將追究法律責任。

相關文章