标签【SQLServer】下的文章

SQL

对于一些自表关联的表,想要查出一条记录和它的所有下属子级,可以用下面的语句:sqlserver: with my1 as(select * from aaa where id = 1 union all select aaa.* from my1, aaa where my1.id = aaa.pid ) select * from...