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:
Hope this is clear! Thanks for any help you can offer.
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.
Your password has been sent to:firstname.lastname@example.org
To follow this tag...
Thanks! We'll email you when relevant content is added and updated.
Share this item with your network: