Home » SQL & PL/SQL » SQL & PL/SQL » Tree Walking
icon14.gif  Tree Walking [message #214572] Wed, 17 January 2007 02:52 Go to next message
manorapps
Messages: 7
Registered: December 2006
Location: Hyderabad
Junior Member

Hi peeps,
Can anybody help me out how to print the heirarchy levels of emp table. Mostly appreciated if u send me related examples.
Thanking you
your lovingly
Manorapps
Re: Tree Walking [message #214574 is a reply to message #214572] Wed, 17 January 2007 03:01 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
How about this thread? Or this one?

Search for "connect by prior" and you'll find more.

MHE
Re: Tree Walking [message #214575 is a reply to message #214572] Wed, 17 January 2007 03:01 Go to previous messageGo to next message
pavan_034
Messages: 16
Registered: October 2006
Junior Member
hi manor..... Laughing

try this...........
set pages 999
set lin 999
select lpad(ename,length(ename)+level*3) ename,level from emp
start with mgr is null
connect by prior empno=mgr;


ramz

[Updated on: Wed, 17 January 2007 03:06]

Report message to a moderator

Re: Tree Walking [message #214626 is a reply to message #214572] Wed, 17 January 2007 05:37 Go to previous message
manorapps
Messages: 7
Registered: December 2006
Location: Hyderabad
Junior Member

Thank You Mr.Maheer, it was exactly what i was looking for.
Bye
Thanks alot
Manor
Previous Topic: Find the Last Friday of the current month (PL/SQL)
Next Topic: Quick question about comparisons.
Goto Forum:
  


Current Time: Fri Dec 02 23:00:04 CST 2016

Total time taken to generate the page: 0.08559 seconds