;with cte as
(
select id,ParentCategoryId from Category where id = 17
union all
select a.id,a.ParentCategoryId
from Category a join cte b on a.ParentCategoryId = b.id
where a.id is not null
)

select * from cte

相关文章:

  • 2022-03-02
  • 2022-12-23
  • 2021-12-19
  • 2021-12-19
  • 2021-07-07
  • 2021-12-01
  • 2021-11-30
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-02
  • 2022-12-23
  • 2021-06-09
  • 2021-12-19
相关资源
相似解决方案