用SQL实现递归
单表:
select t.typeId,t.typeName,t.parentId from t_data t
start with t.typeId = 3
connect by prior t.typeId = t.parentid
?
关联表:t_ues_pic_rescategory目录表,t_ues_resource 资源表 关联列categoryId
该语句实现递归查询某个目录(包括子目录)下所有资源
select r.*, tp.categoryname
? from t_ues_resource r,
?????? (select t.categoryid, t.categoryname
????????? from t_ues_pic_rescategory t
???????? start with t.categoryid = 27
??????? connect by prior t.categoryid = t.parentid) tp
?where r.categoryid = tp.categoryid
?order by r.uploadtime desc