How to get all child nodes from a parent node

I want the parent node,child node,grand child node,grand child node, etc....


SELECT `LeftN`, `RightN` FROM amount WHERE `LeftN`= 'AMSXATUMI' OR `RightN`='AMSXATUMI' OR `SId`= 'AMSXATUMI' OR `SId` IN (SELECT `LeftN` FROM amount WHERE `SId` = 'AMSXATUMI') OR `SId` IN (SELECT `RightN` FROM amount WHERE `SId` = 'AMSXATUMI')

I am using this query. But i got some nodes only like


      LeftN      RightN
                  AMSXATUMI       
                         AMSKEGUSU
                  AMSHUZEDU      AMSWIWEDE

But it should get datas like below:

 AMSKEGUSU------- AMSHUZEDU  AMSWIWEDE
AMSHUZEDU----- AMSGAFOVU AMSBUCEVO
AMSWIWEDE-------AMSLUHERE   AMSDENIBA

AMSGAFOVU------AMSNUFEBE  AMSVASETE
AMSBUCEVO------AMSBOHOKA  AMSJIPEBA

AMSLUHERE------ etc
AMSDENIBA------ etc

AMSNUFEBE------ etc
etc---- etc
and etc....

Example:

When i select(AMSXATUMI)  this id ,i want like this:

SId

AMSKEGUSU
AMSHUZEDU
AMSWIWEDE
AMSGAFOVU
AMSBUCEVO
AMSLUHERE
AMSDENIBA
AMSNUFEBE
AMSVASETE
AMSBOHOKA
AMSJIPEBA.....

and etc.....


I want to display all child links from one parent node
amount.sql
jnj_web_solutionsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

virmaiorCommented:
the table structure is not sufficiently clear to me to answer your question...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Vee_ModCommented:
I've requested that this question be deleted for the following reason:

jnj_web_solutions,<br /><br />Welcome to EE - we are glad that you joined us.<br />&nbsp;<br />Please review the information at the links below for methods of managing your own question:<br />Asking: <a href="http://www.experts-exchange.com/help/viewHelpCategory.jsp?helpCategoryID=3">http://www.experts-exchang<wbr />e.com/help<wbr />/viewHelpC<wbr />ategory.js<wbr />p?<wbr />helpCate<wbr />goryID=3</a><br />Closing: <a href="http://www.experts-exchange.com/help/viewHelpPage.jsp?helpPageID=24">http://www.experts-exchang<wbr />e.com/help<wbr />/viewHelpP<wbr />age.jsp?<wbr />he<wbr />lpPageID=2<wbr />4</a><br />Deleting: <a href="http://www.experts-exchange.com/help/viewHelpPage.jsp?helpPageID=25">http://www.experts-exchang<wbr />e.com/help<wbr />/viewHelpP<wbr />age.jsp?<wbr />he<wbr />lpPageID=2<wbr />5</a><br /><br />You should never &quot;Accept&quot; a comment as a solution unless it is one. I have re-opened this question and will start the auto-delete process.<br /><br />Also, I see that you have asked this question 3 times now. Please only ask the same question once, then respond to the experts trying to help you in that one question.<br />&nbsp;<br />Vee_Mod<br />Experts-Exchange Moderator<br />
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.