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)
 Query for Heirarchical results....

Author  Topic 

bobanjayan
Yak Posting Veteran

67 Posts

Posted - 2004-07-23 : 06:34:44
Hi,

select lpad(' ',2*(level-1)) || to_char(child) s
from test_connect_by
start with parent is null
connect by prior child = parent;

This is an example of query used in Oracle for Heirarchical results.

Is there any thing like this in SQL Server?
It is little urgent...Please..

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-07-23 : 07:55:40
nope there is no such thing in sql server.

check out this article here:
http://www.sqlteam.com/item.asp?ItemID=8866

Go with the flow & have fun! Else fight the flow :)
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2004-07-23 : 09:19:06
here's one way to do it, with an example:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=25964

That's probably the easiest way, w/o restructuring your data.

- Jeff
Go to Top of Page
   

- Advertisement -