Hierarchical data model in mysql

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

how to write tree structure query for following table. the table is dynamically add , delete ,edit so that query should be dynamically. In Oracle very easy retrieve the query.

how to retrieve the result using mysql database.


node_id  : parent_id  : name  : type


1  : 0  : root  : dir

2  : 1  : P1  : dir

3  : 2  : C1  : file

4  : 2  : C2  : file

5  : 1  : P2  : dir

6  : 5  : C1  : file

7  : 5  : C2  : file

8  : 5  : P2_1  : dir

9  : 8  : P2_1_C1  : file

Answers

http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/ http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/10425268/hierarchical-data-model-in-mysql

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils