[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 990
  • Last Modified:

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
0
jnj_web_solutions
Asked:
jnj_web_solutions
1 Solution
 
virmaiorCommented:
the table structure is not sufficiently clear to me to answer your question...
0
 
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now