我思故我強

          oracle遞歸查詢語句

          oracle遞歸查詢語句
          表結構:表 fso_sdept, 字段 dept_id(部門ID)、dept_name(部門名稱)、dept_p_id(父部門ID)

          包含父部門和子部門
          select dept_id,dept_name from fso_sdept where dept_stat=1
          start with dept_id=1129 connect by prior dept_id=dept_p_id

          不包含父部門只包含子部門
          select dept_id,dept_name from fso_sdept where dept_stat=1
          start with dept_p_id=1129? connect by prior dept_id=dept_p_id

          posted on 2007-12-25 10:06 李云澤 閱讀(645) 評論(0)  編輯  收藏 所屬分類: Oracle

          主站蜘蛛池模板: 溧阳市| 囊谦县| 集贤县| 江门市| 长顺县| 通化市| 蕉岭县| 花垣县| 化州市| 郯城县| 额尔古纳市| 巫溪县| 翁牛特旗| 诸暨市| 神木县| 清涧县| 临西县| 保康县| 龙海市| 莲花县| 同江市| 南陵县| 班玛县| 澎湖县| 沙湾县| 乌鲁木齐县| 庆云县| 奉新县| 德保县| 分宜县| 买车| 子洲县| 永康市| 萨迦县| 卢氏县| 图木舒克市| 汝城县| 洛阳市| 长白| 和平区| 海阳市|