>I want to have all the items into a recorset with only one query like
>Select id, reference, component from NOMS where reference = '00004'
>but i want not only the primary relations, i want all relations.
>Could somebody help a newbie like me?

It can also help to change the way you look at the relationships, and use nested sets. 
With nested sets you do not record the parent-child relationship but rather the range 
that a given entity has control of.

So instead of having a manager with an ID of 1 and having three employees with a 
manager field pointing to 1, you have three employees numbered 1,2,3 and the manager 
has a left_value and a right_value of 0 and 4 respectively.

That is an over-generalization, but check the following links. BTW original credit for 
the idea goes to Joe Celko and I reccommend his book "SQL for Smarties".

http://www.sitepoint.com/article/1105 - Tutorial on this that uses PHP
http://www.dbmsmag.com/9603d06.html - More detail from Celko
http://www.dbmsmag.com/9604d06.html - "
http://www.dbmsmag.com/9605d06.html - "
http://www.intelligententerprise.com/001020/celko.shtml
 http://searchdatabase.techtarget.com/tip/1,289483,sid13_gci5 37290,00.html 



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to