5 pts.
 Return specific level parent
Can anyone help?
I have a table, with 7 records

ID ParentID Level
------- ------------- ---------------
01 (empty) 1
A 01 2
BC A 3
X BC 4
B 01 2
DE B 3
Y DE 4

I need a query to return, for every record in the table, the corresponding 'Level 2' ID, excluding records with a Level of 2 or higher (i.e. 1 in the above example), so my result set would be:

ID HouseID
------- ----------
BC A
X A
DE B
Y B

Hope this is clear! Thanks for any help you can offer.
ASKED: Oct 22, 2008  11:04 AM GMT
UPDATED: October 22, 2008  12:45:31 PM GMT
5 pts.

Answer Wiki:
Last Wiki Answer Submitted:  Oct 22, 2008  11:04 AM (GMT)  by  Paulvian   5 pts.
To see other answers submitted to the Answer Wiki View Answer History.
Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _