MySQL Forums
Forum List  »  Oracle

hierarchique
Posted by: lionel chauvier
Date: November 23, 2004 06:49PM

I would like to know to translate this requete oracle into mysql.
Without the clause "start with" and "connect by".

SELECT cd.CATEGORIES_NAME FROM CATEGORIES_DESCRIPTION cd,CATEGORIES c
WHERE cd.CATEGORIES_ID= c.CATEGORIES_ID
start with c.PARENT_ID == 0
connect by c.PARENT_ID = c.CATEGORIES_ID

example :
+------------------------------+---------------+-------------+
| CATEGORIES_NAME | CATEGORIES_ID | PARENT_ID |
+------------------------------+---------------+-------------+
| Apples | 21 | 27 |
| Golds | 23 | 21 |
| Grany | 24 | 21 |
| Golden | 25 | 21 |
| Fruits | 27 | 0 |
| Banana | 21 | 27 |
| Vegetables | 28 | 0 |
+------------------------------+---------------+-------------+

Result :

|-Fruits
|--- Apples
|----- Golds
|----- Golden
|----- Grany
|--- Banana

|-Vegetables

Thank you. ;-)

PS: For when the migration of this clause?

Chauvier L
info@v-ga.be

Options: ReplyQuote


Subject
Views
Written By
Posted
hierarchique
4340
November 23, 2004 06:49PM
3118
November 23, 2004 08:19PM
2161
November 24, 2004 02:22PM
2106
November 24, 2004 03:51PM
2397
November 25, 2004 11:59AM


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.