I have a table tbl
in SQL Server. Here's what the data in that table looks like:
In SystemPartLevel
I save the value of parent (SystemPartID
)
I have to show these records in a treeview in C# like this:
I need a SQL query that will show all children of 'A' or 'B'.
I want to see all child of every node.
For example for 'A' =
{A1, A2, A1-1, A1-2, A1-1-1}
or for A1 =
{A1-1, A1-2, A1-1-1}
How can I write this query?
Thanks