Click here to Skip to main content
15,889,034 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have SQL table for Binary tree.

Id | Name | Parent_ID |

i want to calculate 5 levels of complete binary tree for parameter node which is passed to stored procedure.


What I have tried:

Recursive function
Using while loop
Posted
Updated 9-Jan-20 1:03am
v2
Comments
OriginalGriff 9-Jan-20 5:59am    
So show us what you have tried, explain what it did that you didn't expect or didn't do that you did, tell us what you have tried to fix that.
Tell use where you are stuck, what help you need.

Use the "Improve question" widget to edit your question and provide better information.
Member 14221689 10-Jan-20 2:35am    
Hi i Have already tried that, but i am confuse how exactly i can do that.
OriginalGriff 10-Jan-20 3:13am    
Show us the code that didn't work, explain what it did.
Just hover your mouse over the question until you see "Improve question" in green at the bottom, and click it. That will let you edit the question and provide us with actual information.

1 solution

For MS SQL Server, please read this: Hierarchies WITH Common Table Expressions | Microsoft Docs[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900