Subject | CTE Recursive left join problem |
---|---|
Author | Germán Balbi |
Post date | 2017-10-02T17:37:37Z |
Hello everyone I'm having a problem, and I do not understand why. I have a structure similar to:with recursive
aux as (
select 0 as n
from rdb$databaseunion allselect aux.n + 1
from aux
where aux.n <= 20
)select aux.n, mytable.id
from aux
LEFT JOIN mytable on aux.n between mytable.id and mytable.id +1where mytable.id is not nullWhere the left join behaves as join.Any condition that I put in the clause WHERE referred to mytable, converts the LEFT JOIN into JOIN