sql递归查询

mac2022-06-30  64

--获得上级 with my as ( select * from TB_Area where AreaID=72344566572777472 union all select aa.* from my,TB_Area aa where my.ParentID=aa.AreaID ) select * from my go --获得下级 with my as ( select * from TB_Area where AreaID=72339069014638592 union all select aa.* from my,TB_Area aa where my.AreaID=aa.ParentID ) select * from my

 

转载于:https://www.cnblogs.com/daixingqing/archive/2012/11/13/2768275.html

最新回复(0)