Solved

SQl Connect by

Posted on 2011-03-10
1
238 Views
Last Modified: 2012-05-11
Hi,
Attached contains the output of the query and sql. I would like my out put to be like below..All continenets should be below a static text"WORLD". Please let me know how can I do it. Please let me know if this is not clear.

table-export.xls
0
Comment
Question by:Sthokala
1 Comment
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 35096346
Try this
select asid,name from
(
select 1 sortorder, 0, asid, 'WORLD' name from dual
union all
SELECT 2, a.id AS
id,
  lpad(' ',  (LEVEL -1) *4,   '-') || a.name as Name 
FROM ref_region a START WITH a.containingregion IS NULL CONNECT BY PRIOR a.id = a.containingregion
)
order by sortorder, name

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need help with Oracle syntax 4 56
Oracle Subquery bad Join 11 59
Determine Who is Runnig my Bash Shell Script 4 61
database upgrade 8 37
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now