Solved

SQl Connect by

Posted on 2011-03-10
1
241 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the 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

734 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