469,327 Members | 1,251 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,327 developers. It's quick & easy.

Records in hirarchial

kiss07
99
Hi,

In employee table i want to display records in hirarchial
order.How can i do it..I want query.Hirarchial means follwing:

Personal Manager
----Manager
-----Team Leader
------Team Member
--------Tester..

Its Ok.Anybody ..Pls

Regards,
Arun..
May 3 '07 #1
4 1037
frozenmist
179 Expert 100+
Hi,

In employee table i want to display records in hirarchial
order.How can i do it..I want query.Hirarchial means follwing:

Personal Manager
----Manager
-----Team Leader
------Team Member
--------Tester..

Its Ok.Anybody ..Pls

Regards,
Arun..

You can do it if there is a column to identify the level
May 3 '07 #2
debasisdas
8,127 Expert 4TB
Expand|Select|Wrap|Line Numbers
  1. COLUMN EMPLOYEE FORMAT A20
  2.  
  3. SELECT LEVEL,LPAD(' ',2*(LEVEL-1))||ENAME "EMPLOYEE" ,EMPNO,MGR FROM EMP
  4. START WITH MGR IS NULL CONNECT BY PRIOR EMPNO=MGR
  5.  
  6.  
Please try the above code in SCOTT schema on EMP table...
May 3 '07 #3
kiss07
99
Dear deba,

Thanku very much.

Arun
May 3 '07 #4
debasisdas
8,127 Expert 4TB
Dear Arun

U are always welcome

But why u want code everytime in all your posts.

try somthing by yourself.

If u can't solve it then only post in forum.

Debasis
May 3 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by CSDunn | last post: by
5 posts views Thread by Grant | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.