Support for hierarchical queries?
Which version of MySQL supports an equivalent to the Oracle "connect by" clause?
For example:
select all customerid, name, level as lev
from table t
where level > 1 and orderstatusid = 1
start with custid = 1
connect by prior customerid = referralid and level <= (9)
This query grabs all of the customers and who the customers referred, and who they in turn referred, down the "referral tree" for eight levels starting with a specific customer. This query will exclude all customers that do not have a orderstatusid of 1, and will also exclude the starting customer.
In Oracle all, level, start with, connect by, prior are all reserved words.
Thanks.
Subject
Views
Written By
Posted
Support for hierarchical queries?
11297
August 26, 2004 03:30PM
6029
September 26, 2004 07:46AM
3868
May 12, 2005 05:24PM
3722
August 02, 2006 04:27AM
4359
February 02, 2005 12:44AM
5646
February 02, 2005 12:53AM
3926
October 18, 2006 12:54AM
4210
October 23, 2006 02:12PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.