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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Recursive Query

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-05-07 : 11:22:28
Faisal writes "Hello,
dears let me explain my scenario first.
i have a parent child relation.
i want to select a child and all its parents.
like
if i have
Scope 
Scope1
Scope2
Scope3
Scope3.1
Scope3.2
Scope3.3(this task assigned to a user now i want to get this task and all it's parent tasks like)


Scope
Scope3
Scope3.3(i want to get this data))

i need your help.
be quick and straightforward
bye
Faisal Dar"

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2004-05-07 : 11:28:04
self join on child.parent = parent.child ... do that for every level in the tree

Jay White
{0}
Go to Top of Page
   

- Advertisement -