October 16, 2012 at 12:32 am
i have a table like
TID PID DSC
1 0 Parent1
2 1 Child1
3 1 Child2
4 1 Child3
5 0 ParentA
6 5 ChildA
7 5 ChildB
October 16, 2012 at 12:51 am
Well, nobody can help with this limited amount of information
Please describe your issue and give us some sample data and the expected results as per your sample data
It would be really good if you can provide this in a readily usable format
If you are not sure on how to do this, reading the link in my signature would give you a good idea
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 16, 2012 at 8:04 am
sureshk 23318 (10/16/2012)
i have a table likeTID PID DSC
1 0 Parent1
2 1 Child1
3 1 Child2
4 1 Child3
5 0 ParentA
6 5 ChildA
7 5 ChildB
That's what's known as an "Adjacency List". They usually hold a hierarchical tree of data. An "Adjacency List" is very easy for even humans to maintain but are seriously performance challenged when it comes to processing. If it were me, I'd build a Nested Sets structure into this table for the best of both worlds.
It would appear that you're either missing the very top level or you don't mind working with multiple trees known as a "forest". The problem with the missing the top level is that you can't actually have any DRI between the PID and the TID column.
I also agree with the previous post... what is the actual querstion here?
--Jeff Moden
Change is inevitable... Change for the better is not.
October 16, 2012 at 8:18 am
May be the post should read like:
Have I table like a:.... ?
:hehe:
Actually the question is in the post title:
If anyone can help? ...
The answer is: Yes, definitely someone can help!
😉
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply