9 messages in com.mysql.lists.win32RE: parent, child
FromSent OnAttachments
Leang Pechakrith Titya22 Sep 2004 07:14 
Jordan Sparks22 Sep 2004 07:40 
David Blomstrom22 Sep 2004 10:46 
SGr...@unimin.com22 Sep 2004 11:58 
Jordan Sparks22 Sep 2004 12:43 
Jordan Sparks22 Sep 2004 12:59 
Patino, Hernando22 Sep 2004 13:26 
David Blomstrom22 Sep 2004 13:36 
Patino, Hernando22 Sep 2004 13:51 
Subject:RE: parent, child
From:David Blomstrom (davi@yahoo.com)
Date:09/22/2004 01:36:39 PM
List:com.mysql.lists.win32

Thanks for the tips, both of you. It will probably be a while before I'm ready to tackle the more advanced hierarchical formula, but that should be my long range goal. I've also learned of some taxonomic software programs that I'll have to check out.

Lots to learn!

--- Jordan Sparks <jspa@free-dental.com> wrote:

One more thing. It's essentially the same as:

SELECT animals1.AnimalName,animals2.Parent FROM animals AS animals1,animals AS animals2 WHERE animals1.Parent=animals2.AnimalName

Except that if an animal doesn't have a parent, the above query will exclude that animal. The query below will include that animal, and the parent name will be null.

Jordan Sparks

* * * * * * * * * *

Hernando Patino wrote:

I you are working with taxonomy data, most likely you will end up working with hierarchical relationships (variable nodes) rather than plain relational data. Although mySQL does not yet support SQL hierarchical queries there are workarounds as the ones already explained in the mailing list.

For a nice discussion about this type of queries and retrieving data stored in a relational database, please check:

http://www.sitepoint.com/article/hierarchical-data-database

The article is titled: Storing Hierarchical Data in a Database by Gijs Van Tulder

This article will give a better solution that can be implemented in mySQL. However, is a little bit complicated to do maintenance, but the taxonomy data does not change every minute, so it won't be difficult to use that approach.