本文主要是介绍姚博文 cte 公用表表达式Common Table Expression,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
with recursive dic as (
select a.id,a.name,a.parent_id,a.level from country a where name='internal' and level=1 and type=3
union all
select k.id,k.name,k.parent_id,k.level from country k , dic c where k.parent_id = c.id
select a.id,a.name,a.parent_id,a.level from country a where name='internal' and level=1 and type=3
union all
select k.id,k.name,k.parent_id,k.level from country k , dic c where k.parent_id = c.id
)select * from dic ;
这篇关于姚博文 cte 公用表表达式Common Table Expression的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!