看sql reference中遞歸sql的用法(connect by ,start with)
然后根據自己的情況寫