怎样用一条语句可以查询上级所有部门,详细内容请进来看 什么意思,是不是这样select * from table_name where (dept<'e'); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select dept from table_name where dept<>'e' start with id=(select id from table_name where dept='e') connect by prior parent=id; select dept from table_name where id >= (select parent from table_name where dept='e') select dept from table_name where dept<>'e' start with id=(select id from table_name where dept='e') connect by prior id=parent; 或者是C的下级所有部门(c,d,e),总之就是我随便给出一个部门ID,可以查询这个部门的下级所有部门 谁是a的下级,b,c,d,都是嘛 select dept from table_name where parent = (select id from table_name where dept = 'a'); 呵呵,不好意思我拿了最大一级a来问了,可能我说得不太清楚当拿a查询的时候查出的是全部记录,但拿C查询的时候下级所有部门只有(c,d,e)(包含C本身),总之就是我随便给出一个部门ID,可以查询这个部门的下级所有部门(包含本身) ORA-00911: 无效字符 。 求高手解答。 100分,急!!返回多条数据拼接成一条记录的存储过程!! 多线程数据库加锁 嵌套查询问题??? 帮帮忙 请问如何能定时清空一张表 请教为什么在windows2000里的管理工具services里没有OracleoraHome90ManagementServer? 求助 ORA-271000:shared memory realm already exists(已有答案)的解决方法 连接服务器的问题 十万火急,在线等待关于oracle的oci的资料 返回sql code的问题?? 有用Oracle Develop进行开发的吗?
dept
from
table_name
where
dept<>'e'
start with id=(select id from table_name where dept='e')
connect by prior parent=id;
from table_name
where id >= (select parent from table_name where dept='e')
dept
from
table_name
where
dept<>'e'
start with id=(select id from table_name where dept='e')
connect by prior id=parent;
当拿a查询的时候查出的是全部记录,但拿C查询的时候下级所有部门只有(c,d,e)(包含C本身),总之就是我随便给出一个部门ID,可以查询这个部门的下级所有部门(包含本身)