我有一个 sql 数据库表
CREATE TABLE [dbo].[LedgerGroups](
[GroupName] [varchar](50) NOT NULL primary key,
[GroupParent] [varchar](50) NULL
)
表中的记录是
-----GroupName------ ---GroupParent---
Bangalore Customers Karnataka Customers
Chennai Customers Tamilnadu Customers
Customers NULL
Ernakulam Customers Kerala Customers
Hubli Customers Karnataka Customers
Karnataka Customers Customers
Kerala Customers Customers
Kollam Customers Kerala Customers
Nagercoil Customers Tamilnadu Customers
Suppliers NULL
Tamilnadu Customers Customers
Tirunelveli Customers Tamilnadu Customers
我如何查询表以便我可以获得特定值的所有子项。例如,如果我给Customers
它应该返回其父级是客户及其子级的子级的所有行,依此类推..