这是一个树结构,查询教师“胡明星”的所有主管及姓名:(无主管的教师也需要显示),显示(教师编号、教师名称、主管编号、主管名称)
SELECT T.*, M.TEACHER_NAME MGR_NAME FROM HAND_TEACHER T, HAND_TEACHER M WHERE T.MANAGER_NO=M.TEACHER_NO(+) START WITH T.TEACHER_NAME='胡明星' CONNECT BY T.TEACHER_NO=PRIOR T.MANAGER_NO