parent
6f4491f1b0
commit
6377bd0ebf
@ -0,0 +1,16 @@
|
|||||||
|
#namespace("YunXiao")
|
||||||
|
#sql("datasetTree")
|
||||||
|
WITH RECURSIVE tree_cte AS (
|
||||||
|
SELECT *
|
||||||
|
FROM dataease.core_dataset_group
|
||||||
|
WHERE id = 1072161072829566976 -- 上线
|
||||||
|
UNION ALL
|
||||||
|
SELECT c.*
|
||||||
|
FROM dataease.core_dataset_group c
|
||||||
|
INNER JOIN tree_cte t ON c.pid = t.id
|
||||||
|
)
|
||||||
|
SELECT t1.id ,t1.name ,t1.pid,t1.node_type,t2.name as parent_name FROM tree_cte as t1
|
||||||
|
inner join dataease.core_dataset_group as t2
|
||||||
|
on t1.pid=t2.id
|
||||||
|
#end
|
||||||
|
#end
|
Loading…
Reference in new issue