MySQL Forums
Forum List  »  Docs

Snail trail
Posted by: Patrick Zahra
Date: March 22, 2007 06:06AM

I have a hierarchal database structure here like so:

item_id, parent_id, label

where parent_id=item_id of the item above it. Pretty straight forward. How do I select a snail trail from a specific item (where parent_id could be anything) all the way to the top (where parent_id=0) using only a single sql call? Does that need variables?

Options: ReplyQuote


Subject
Views
Written By
Posted
Snail trail
4106
March 22, 2007 06:06AM


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.