BDY.RTF
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
ntion in
human history - with the possible exceptions of handguns and tequila."
_
-Original Message-
From: antiphobo [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 24, 2001 11:28 AM
To: php-db
Cc: antiphobo
Subject: FW: [PHP-DB] Tree structures...
What's the best way to deal
What's the best way to deal with tree structures? Use the following setup in
a database as an example:
ID | Parent | Description
1 || Colours
2 |1 | Red
3 || Hello
4 |1 | Green
5 | 4 | Light
6 | 4 | Dark
This should be
Joe Celko wrote a book called "SQL for Smarties" that has about 20 pages
devoted to representation of trees in SQL. I believe he also has a website.
His quick take on representing trees in SQL is that hierarchical databases
do this far better and a RECURSIVE UNION funtion is needed to do this