Topic: SQL*Plus and PL/SQL >> A query
|
Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property.
You may review the entire Oracle Certification Program Candidate Agreement online Here.
|
|
|
|
| Jerry T |
Posted: Jan 13, 2008 08:41:56 AM |
Total Post: 3
Joined: Jan, 2008
|
All ,
I need a query which shows the first three levels
of the table, indicating for each row whether it is a leaf row .
Thanks ,
Jerry P |
|
|
Vinod |
| Posted: Jan 13, 2008 08:45:30 AM | |
|
Total Post: 54
Joined: Oct, 2007
|
The following example shows the first three levels of table Comp, indicating for each row whether it is a leaf row
SELECT last_name "Comp", CONNECT_BY_ISLEAF "IsLeaf",
LEVEL, SYS_CONNECT_BY_PATH(last_name, '/') "Path"
FROM Comps
WHERE LEVEL <= 3 AND department_id = 80
START WITH Comp_id = 100
CONNECT BY PRIOR Comp_id = arc_id AND LEVEL <= 4;
-Vinod
|
|
|
|
|
Jerry T |
| Posted: Jan 13, 2008 08:47:07 AM | |
|
Total Post: 3
Joined: Jan, 2008
|
Excellent !! Thanks for your prompt reply !! much appreciated !!
Cheers,
Jerry
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |
|
|
|
|
Forum Rules & Description
Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user
|
| |
Get FREE Magazines
|
Top 10 Forum User
|
| Murtuja Khokhar | 843 |
| Mohammed Taj | 746 |
| positive fanatic | 483 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 386 |
| Gitesh Trivedi | 322 |
| Gopu Gopi | 272 |
| neeraj sharma | 252 |
| Ramesh Jois | 245 |
| Bishal Khetan | 207 |
|
|