Click here to Skip to main content
15,917,005 members
Home / Discussions / Database
   

Database

 
AnswerRe: Which dlls do my setup package need to implement ADO compnnet? Pin
Mike Dimmick24-May-07 13:32
Mike Dimmick24-May-07 13:32 
QuestionRe: [Message Deleted] Pin
Hamid_RT24-May-07 22:04
Hamid_RT24-May-07 22:04 
AnswerRe: [Message Deleted] Pin
Colin Angus Mackay24-May-07 22:24
Colin Angus Mackay24-May-07 22:24 
Questionquery about counting records entered in same date... Pin
nareshss23-May-07 22:16
nareshss23-May-07 22:16 
AnswerRe: query about counting records entered in same date... Pin
Harini N K23-May-07 22:28
Harini N K23-May-07 22:28 
GeneralRe: query about counting records entered in same date... Pin
nareshss23-May-07 23:07
nareshss23-May-07 23:07 
AnswerRe: query about counting records entered in same date... Pin
Shiv Singh Sisodiya24-May-07 1:33
Shiv Singh Sisodiya24-May-07 1:33 
Questionfind the level of a node having not more than two nodes under him in a tree like SQL SERVER 2005 database hierarchey Pin
singhal's23-May-07 20:45
singhal's23-May-07 20:45 
Sleepy | :zzz: hi all,
i am a new guy..
i get good results from Recursive queries in sql server 2005 to count no of childs unde a node in a tree.

but now i am facing a problem ???

i have to define the level of a node ..

the case is as : starting from the rootnode of tree every node can have maximum of two node as left node and right node. not more than two node under a node.
so at level zero means root of node contains zero nodes.
suppose A is root of tree. first ledt node of A will be create afetr that right node a will be create. now A have two members under him so A is now at level one.
as suppose A have two node B(left)/C(right). and node B contais D/E as left right node and C(right of A ) contains F/G as Left/right node than at this level B exactly contains two nodes under him as well as C conyais two nodes . so binary has been complete. so now A is at level two.
now D has left only and G has only left node so at this level D E F G are uncomplete (having less tahn two nodes ) so now a is at two level.
so this is the pattern for that structure..
so have to et the level for every node in the tree.
now can i do
i am using asp . net 1.1/C# and sql server 2005.
This is the table structure for above :---
-------------------------------------------
Id name ParentId Left Right
--------------------------------------------
1 A -1/null 0 1
------------------------------------------
2 B 1 0 1
-------------------------------------------
3 C 1 0 1
--------------------------------------------
4 D 2 0 -1
----------------------------------------------
5 E 2 -1 -1
----------------------------------------------
6 F 3 -1 -1
-----------------------------------------------
7 G 3 0 -1
------------------------------------------------
8 H 4 -1 -1
--------------------------------------------
9 I 7 -1 -1
-----------------------------------------------
parent of A has null or -1 as reference .if a node has keft child that is represent by zero and for right one .
if a node does not contains any node this left=right will be -1;

so plz help me how can i set the level of a node in the tree.
the depth can be up to 50,000 node.



jh hsg sabdhas avdhagd advahgd axva

QuestionDisplay latest record in sqlserver(Its urgent need)..., [modified] Pin
Member 387988123-May-07 19:54
Member 387988123-May-07 19:54 
AnswerRe: Display latest record in sqlserver(Its urgent need)..., Pin
Navneet Hegde23-May-07 21:12
Navneet Hegde23-May-07 21:12 
GeneralRe: Display latest record in sqlserver(Its urgent need)..., Pin
Member 387988123-May-07 22:59
Member 387988123-May-07 22:59 
AnswerRe: Display latest record in sqlserver(Its urgent need)..., Pin
NewWhere23-May-07 23:49
NewWhere23-May-07 23:49 
Questionclustering Pin
82.san23-May-07 19:41
82.san23-May-07 19:41 
AnswerRe: clustering Pin
Navneet Hegde23-May-07 21:23
Navneet Hegde23-May-07 21:23 
GeneralRe: clustering Pin
82.san23-May-07 21:34
82.san23-May-07 21:34 
GeneralRe: clustering Pin
Expert Coming24-May-07 21:03
Expert Coming24-May-07 21:03 
Questionquery to count orders for particular date disp by datewise Pin
nareshss23-May-07 19:16
nareshss23-May-07 19:16 
AnswerRe: query to count orders for particular date disp by datewise Pin
_Damian S_23-May-07 19:23
professional_Damian S_23-May-07 19:23 
GeneralRe: query to count orders for particular date disp by datewise Pin
nareshss23-May-07 19:37
nareshss23-May-07 19:37 
GeneralRe: query to count orders for particular date disp by datewise Pin
shally_7924-May-07 1:58
shally_7924-May-07 1:58 
Questionhow to find the 10th highest paid employee in an employee table Pin
saravanan0523-May-07 19:00
saravanan0523-May-07 19:00 
AnswerRe: how to find the 10th highest paid employee in an employee table Pin
Blumen23-May-07 19:17
Blumen23-May-07 19:17 
AnswerRe: how to find the 10th highest paid employee in an employee table [modified] Pin
Navneet Hegde23-May-07 19:54
Navneet Hegde23-May-07 19:54 
QuestionOracle SPs to SQL SP Pin
Blumen23-May-07 18:38
Blumen23-May-07 18:38 
QuestionAdding column values Pin
yuvachandra23-May-07 2:38
yuvachandra23-May-07 2:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.