Hi Burhan! I have an old article on the Evolt site which *may* help you along in your thinking. The problem in my case was how to build a hierarchical list (for use in a menu for instance) from a list of items in a database. There are some functions in the code that find children in a relationship and that can "step up" the hierarchy to find the next branch. You may be able to modify some of the ideas there to help you along. http://evolt.org/article/BBS_style_recursion_How_To/17/3962/index.html There's another article dealing with recursive concepts in hierarchical data here: http://evolt.org/article/Four_ways_to_work_with_hierarchical_data/17/4047/in dex.html hth. .steve ------------------------------------- Cookstour - http://www.cookstour.org ------------------------------------- > -----Original Message----- > From: Burhan Khalid [mailto:burhankhalid at members.evolt.org] > Sent: den 5 november 2002 13:21 > To: thelist at lists.evolt.org > Subject: [thelist] How to construct this query? > <SNIP> > The problem that he was facing was figuring out how to query the > database to get information on a messages' family (ie, what's > its parent, does it have any children, are the children parents, > etc.) <SNIP> >