posts - 310, comments - 6939, trackbacks - 0, articles - 3
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          Oracle Connect By用法

          Posted on 2010-08-31 16:21 詩特林 閱讀(2581) 評論(0)  編輯  收藏 所屬分類: Oracle
          Oracle Connect By用法

          oracle中的select語句可以用START WITH...CONNECT BY PRIOR子句實現遞歸查詢,connect by 是結構化查詢中用到的,其基本語法是:

          select ... from <TableName>
          where <Conditional-1>
          start with <Conditional-2>
          connect by <Conditional-3>
          ;

          <Conditional-1>:過濾條件,用于對返回的所有記錄進行過濾。
          <Conditional-2>:查詢結果重起始根結點的限定條件。
          <Conditional-3>:連接條件

          select * from t_department where levels=2 start with id = 'D-06-04' connect by prior superior=id;
          主站蜘蛛池模板: 黎川县| 绥芬河市| 舞阳县| 正定县| 乳源| 刚察县| 南昌县| 金阳县| 称多县| 双辽市| 青州市| 布尔津县| 昭苏县| 隆尧县| 黑水县| 兴安县| 邻水| 怀集县| 汤阴县| 东丰县| 呼和浩特市| 泾源县| 五家渠市| 会同县| 普兰店市| 剑阁县| 望都县| 万山特区| 盘锦市| 巩留县| 临泉县| 麦盖提县| 南通市| 南部县| 乌拉特中旗| 沅陵县| 瑞丽市| 息烽县| 斗六市| 博客| 灌云县|