sql 递归查询

with t as(select * from category where categoryid = 1
  union all select category.* from t, category where t.categoryid = category.parentid
  ) select * from t

 

posted @ 2016-06-23 17:17  十七玄月  阅读(132)  评论(0)    收藏  举报