为什么以下查询返回无限行?我本来希望该EXCEPT
条款终止递归..
with cte as (
select *
from (
values(1),(2),(3),(4),(5)
) v (a)
)
,r as (
select a
from cte
where a in (1,2,3)
union all
select a
from (
select a
from cte
except
select a
from r
) x
)
select a
from r
Run Code Online (Sandbox Code Playgroud)