Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: SQL Query -- List of managers

Re: SQL Query -- List of managers

From: Vladimir Begun <Vladimir.Begun_at_oracle.com>
Date: Mon, 31 Mar 2003 17:38:37 -0800
Message-ID: <F001.00576C36.20030331173837@fatcity.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US