>>>>> "Martin" == Martin Smetak <[EMAIL PROTECTED]> writes:

    Martin> Hi all!  Anyone know if it's possible to make a recursive
    Martin> select from a table ?  My problem: I got a table of "some
    Martin> categories" which all points to its parrent
    Martin> one(tree)...shown below. And I want to select all names of
    Martin> parrent categories of one child, lets say "fast[4]". Now
    Martin> I'm solving that with many SQL queries like : "SELECT
    Martin> main_id FROM cat WHERE id=4;"....but I would like to
    Martin> optimize this.

    Martin> Anyone can help or point me to a way ??


The Openacs project has implemented a couple of different methods for
handling tree queries.  Check out these two threads:

http://openacs.org/bboard/q-and-a-fetch-msg.tcl?msg_id=0000eC&topic_id=11&topic=OpenACS

http://openacs.org/bboard/q-and-a-fetch-msg.tcl?msg_id=0000j6&topic_id=12&topic=OpenACS%204%2e0%20Design

Regards,

Dan Wickstrom

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl

Reply via email to