473,396 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to count number of left node and right node in an mlm tree

Hello Friends,

I've a table as given below

Expand|Select|Wrap|Line Numbers
  1. ID LChild RChild
  2. 1      2              3
  3. 2     4               6
  4. 3     5               7
  5. 4    8               9
  6. 5    10          11
  7. 6   12          13
  8. 7    0           14

Now i've to find out the LChild of 1, 1 has 2 in it's left 3 in it's right and 2 has 4,6 as it's child and 4 and 6 has also two-two child each......At final 1 has 7 child on it's left and on it's Right it's 6

i want to Count Left and right node and level for MLM application

And also i've find out for each ID i.e 1,2,3,4,5,6,7
Oct 28 '13 #1
3 2185
Rabbit
12,516 Expert Mod 8TB
Since the tree is numbered incorrectly for a SQL only solution, you will need to use a cursor to implement a recursion.
Oct 28 '13 #2
how,
please tell me how we use cursor for recursion and give the code if you have please it's very urgent for me



thanks in advance
Oct 29 '13 #3
Rabbit
12,516 Expert Mod 8TB
Sorry but this isn't a code writing service. Please make an attempt and post back with your code if you run into trouble and provide the error messages that you get.
Oct 29 '13 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Steve Lamb | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ok, this one has me scratching my head. Right now my application is working fine. I have a tree control which contains a 2-level deep tree. The...
7
by: Alex | last post by:
Hi Everone, I need some advice on how to setup 4 columns where the outside two are absolute (120px) and the inner two (side by side) are relevent (Fluid) and change with the screen. Here's my...
3
by: Brian Henry | last post by:
If i already have a tree view created, and want to add another new node to it, how would i do so? Is there a way to throught tags or anything? like i have this RootNode | +-- Child 1 +--...
3
by: Dan | last post by:
Anyone have any code to place in this procedure to determine what node on my tree view was clicked? Private Sub TreeView1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)...
1
by: cricketunes | last post by:
Hey folks I am implementing the Huffman encoding algorithm. I have created the tree and its perfect. Now while searching for a node value, I need to write a 0 to the encoded file if I am moving...
9
by: sql guy123 | last post by:
I normally use MS ACCESS vs MS SQL,, which has a left() and right() function. I need to use MS SQL for this project but I am not familiar with it. I have read a few books, but can not figure out...
1
by: tina chatterjee | last post by:
i have implemented binary tree insertion and deletion using my on coding. but it was not a tough job till i got confused while deleting a node having both left and right child.I am unable to...
1
by: BeginingOfLife | last post by:
i am using a java script to create a tree view in my html page. i got that script from this link : http://destroydrop.com/javascripts/tree/ given script is static script creations for tree...
1
by: jlt206 | last post by:
This code <?php include("counter.php")?> on the webpage produces the count number. (function code below) I want to place the current number into a variable $MemberNo or into a FormField to be sent...
2
by: Ashumeerut | last post by:
I am having a table tbltestingtree representing the tree structure, Member_Id is the id of the member, Parent_Id represent the Parentid of that member , Lefts and Rights tells us that the member is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.