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)
 Mono-Hierachical Structures

Author  Topic 

sean khan
Starting Member

4 Posts

Posted - 2001-03-27 : 13:31:55
I'm stumped on this one. I have two tables:
tblTerms and tblConnection
tblTerms as the following 2 fields:

term
termNum

tblConnection as the following 2 fields:

NTptr
BTptr

A query like :

SELECT C.NTptr, BT.term, C.BTptr, NT.term
FROM (tblTerm AS BT LEFT JOIN tblConnection AS C ON (BT.termNum = C.NTptr)) LEFT JOIN tblTerm AS NT ON (NT.termNum = C.BTptr) WHERE BT.termNum = 100

Will return all the Narrower terms (NT) whose Broader term (BT) has a termNum = 100

How can I figure out if the NT has children. In other words, in the same query, is there a way of determining if the BTptr is also in the NTptr list ?

   

- Advertisement -