Solved

SQl Connect by

Posted on 2011-03-10
1
242 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 77

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

690 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