473,320 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Equivalent of Hierarchy SQL in Oracle

Hi All,

We have some performance issues with 'CONNECT BY PRIOR' SQL statement and trying to find an alternate SQL which gives the same output.

Example:

ENum-----------------Mgr
Julie
Andrew---------------Julie
Mark-----------------Andrew
Matt-----------------Andrew
Wyatt----------------Julie
Jenny----------------Wyatt

SELECT enum, mgr FROM <table> START WITH enum IS NULL
CONNECT BY PRIOR enum = mgr;

Output:
-------
Julie
---Andrew
------Mark
------Matt
---Wyatt
------Jenny
---Joel

How do I get the same output without using CONNECT BY PRIOR command. I dont mind creating a new table that will keep all the possible combinations between enum and mgr columns.

Please provide your solution. I really appreciate it.


Thanks in advance,
Rao


--
Rao V Chenna
Feb 17 '06 #1
0 1934

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: JBBHF | last post by:
Hi i'm working on a web project, and i would like to make my oracle query work in mysql. select match.numero "nummatch", to_char(match.datematch, 'yyyy-MM-dd') "datematch", p1.numjoueur "j1",...
2
by: gimme_this_gimme_that | last post by:
Assuming data is being stored in a DB2 TIMESTAMP what is the equivalent of Oracle's to_date function : to_date('03/04/2005','MM/DD/YYYY') It's OK if MM/DD/YYYY is the only supported format....
8
by: gimme_this_gimme_that | last post by:
Is there something equivalent to Oracle's SELECT DBMS_LOB.GETLENGTH(COLUMN_NAME) FROM FOO where COLUMN_NAME is a CLOB in table FOO returning an integer with a count of the number of...
14
by: hilz | last post by:
Hi all, What is the equivalent of VARCHAR2 in access? thanks hilz
2
by: Do | last post by:
Hi, I have a database table with the following fields: id, name, parentid. These fields are supposed to create a hierarchy for a list box, an infinite hierarchy Child fields of parent fields...
0
by: Doug Bloebaum | last post by:
In Oracle I can do this: SELECT h.transaction_number CURSOR(SELECT d.detail_number FROM detail d WHERE d.transaction_number=h.transaction_number) FROM header h WHERE...
7
salesmr
by: salesmr | last post by:
I have a query that works fine in Oracle, but I can't seem to get it to work in PHP. The code is: $query = "SELECT lpad(' ', (level - 1) * 4) || emp_name, level "; $query .= "from emp_table";...
2
by: ghe | last post by:
Good day to all, Does anyone here know how to convert the specified Oracle code below into PHP? Oracle Code: TYPE myTable IS TABLE OF varchar2(1) INDEX BY BINARY_INTEGER; If the Oracle code i...
1
DTV12345
by: DTV12345 | last post by:
Greetings! Imagine 2 hosts: host A runs Oracle 10g , host B runs IBM DB2 v9. I have to write a shell script (bask/Korn...) that checks if a database instance is up and running and does a bunch...
0
by: kg6ypx | last post by:
Greetings! Imagine 2 hosts: host A runs Oracle 10g , host B runs IBM DB2 v9. I have to write a shell script (bask/Korn...) that checks if a database instance is up and running and does a bunch...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.