什么意思,是不是这样
select * from table_name where (dept<'e');

解决方案 »

  1.   

    select 
       dept 
    from 
       table_name 
    where 
       dept<>'e' 
       start with id=(select id from table_name where dept='e') 
       connect by prior parent=id;
      

  2.   

    select dept 
    from table_name 
    where id >= (select parent from table_name where dept='e')
      

  3.   

    select 
       dept 
    from 
       table_name 
    where 
       dept<>'e' 
       start with id=(select id from table_name where dept='e') 
       connect by prior id=parent;
      

  4.   

    或者是C的下级所有部门(c,d,e),总之就是我随便给出一个部门ID,可以查询这个部门的下级所有部门
      

  5.   

    谁是a的下级,b,c,d,都是嘛
      

  6.   

    select dept from table_name where parent = (select id from table_name where dept = 'a');
      

  7.   

    呵呵,不好意思我拿了最大一级a来问了,可能我说得不太清楚
    当拿a查询的时候查出的是全部记录,但拿C查询的时候下级所有部门只有(c,d,e)(包含C本身),总之就是我随便给出一个部门ID,可以查询这个部门的下级所有部门(包含本身)