with T(id,[name],pid) as(select 1,N'中国',-1 union allselect 2,N'山东',1 union allselect 3,N'济南',2 union allselect 4,N'青岛',2 union allselect 5,N'历下区',3 union allselect 6,N'崂山区',4 union allselect 7,N'河北',1 union allselect 8,N'石家庄',7),cte as(select id,conv…