Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: SQL Query -- List of managers
Hello
9i (ORA-01489! be aware):
SELECT LTRIM(SUBSTR(SYS_CONNECT_BY_PATH(RPAD(ename, 20, ' '), '/'), 2, 19)) ename
, ename mgrs
FROM emp
CONNECT BY PRIOR mgr = empno
/
Eberhard, Jeff wrote:
> Using the EMP table as an example I want to create a query that will show a
> list of employees and the mgrs above them. Like this:
>
> ENAME MGRS
> --------------- ----------
> SMITH SMITH
> SMITH FORD
> SMITH JONES
> SMITH KING
..
-- Vladimir Begun The statements and opinions expressed here are my own and do not necessarily represent those of Oracle Corporation. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Vladimir Begun INET: Vladimir.Begun_at_oracle.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Mon Mar 31 2003 - 19:38:37 CST
![]() |
![]() |