Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003

    Unanswered: Hierarchical select

    hi, i am new to MySQL, so pardon if the question was addressed before...

    i have a table that contans a hierarchy of albums something like:

    album_id parent_id

    where parent_id is the album_id of the father node. topmost node has a parent_id of "NULL". quantity of child nodes is not limited.

    is there a simple query to get all the parents of album_id (besides doing multiple querries in the loop)? I know Oracle is able to do that with levels.... if not, can somebody suggest an alternative table structure?

    thanks for all your help

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada

  3. #3
    Join Date
    May 2003
    it deals with binary trees, i need something more like a b-tree
    i guest the best way is too grab everything and parse it on the fly

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts