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
 SQL Server Development (2000)
 help me for this complicated query

Author  Topic 

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-08-26 : 10:06:28
Table Structure

id,name,u_id
1,a,3
2,b,null
3,c,6
4,d,5
5,e,1
6,f,null
7,g,null
8,h,null


if i give the input as id=4

i want the o/p as


d
e
a
c
f

based on the u_id.

Please help me. I'm using mssql 2000



Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-08-27 : 02:12:41
Can any one help me?

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-08-27 : 02:22:00
Read about Expanding Hierarchies in sql server help file

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-08-31 : 01:06:52
go through this link
http://vyaskn.tripod.com/hierarchies_in_sql_server_databases.htm
Go to Top of Page
   

- Advertisement -