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)
 Oracle -- Start with Connect by equivalent in Sql

Author  Topic 

thanksfor help
Posting Yak Master

106 Posts

Posted - 2006-11-30 : 18:06:59
Hi,

I need to translate the following query in sql server.

SELECT lpad(' ', 2*level) || CHILDNAME
FROM
parent_child
start with
MANAGERNAME is null
connect by
prior childNAME=MANAGERNAME

Any help is appreciated.

thanks

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-12-01 : 00:10:02
If you are doing this in SQL 2000, check the below link:

[url]http://www.nigelrivett.net/SQLTsql/RetrieveTreeHierarchy.html[/url]

In case of SQL 2005, read about CTEs in BOL.

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page
   

- Advertisement -