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)
 Clause SELECT and CONNECT BY

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-03-18 : 18:55:54
Eric writes "Dear SqlTeam !

I try to use CONNECT BY in the SELECT clause with SQLserver 7.0 / NT 4.0

I've got a database structure like this

MyTable :
Key KeyFather
k1 null
k2 k1
k3 k1
k4 k2

So I use the followed syntax to get a well sorted result

SELECT Key, KeyFather
FROM MyTable
CONNECT BY KeyFather = PRIOR key
START WITH key = 'k1'

and then I got this message from SQLserver 7.0 :

"Server: message 156, level 15, state 1, line 3
Incorrect syntax near the keyword 'BY'."

So I wonder if I'm wrong in the way to use it or if SQLserver 7.0 doesn´t support this SQL feature that I found in a website speaking about all the SQL language.

Thank you very much if you can found out about this problem or if you have any proposition to read this kind of table easily cause I don´t know very well SQL !

Eric"
   

- Advertisement -