Good day, dear forum users! I ask you for help. Stalled on the following:
Initial data: There is an anytab table with id, descr, parentid, isgroup fields. The isgroup = 1 field for groups. The nesting level is different.
Task: Get id and descr values
Condition: Regardless of nesting, get all descendants by the parameter @parent (@parent = parentid) except for those where isgroup = 1, that is, except for groups.
System: MS SQL Server 2008 R2
Thank you in advance!