Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mailtosaja
Starting Member
28 Posts |
Posted - 2008-10-30 : 07:05:49
|
| hi, i have the two table like below.masterdetails(table name)id_1 |id_parent_id|i_root_id|1001 |1001 |10011002 |1001 |10011003 |1002 |10011004 |1003 |10011006 |1003 |10011005 |1002 |1001and [employee time]table nameid_1 |timespent1004 |71006 |81005 | 6i would like to display the result below1001 211002 211003 151004 71005 61006 8it's look like leaf level and parent level.help me..Thanks & Regards,S.Sajan. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-30 : 07:24:43
|
| Are you using sql 2005? if yes make use of recursive CTE to solve this. you can search within these forums. there are lots of posts |
 |
|
|
mailtosaja
Starting Member
28 Posts |
Posted - 2008-10-30 : 07:49:21
|
| hi, Thanks for your reply..Can you give me the details form me..Thanks & Regards,S.Sajan. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-30 : 08:03:10
|
| http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=93830&SearchTerms=recursive,query |
 |
|
|
|
|
|