WITH Clause in SELECT with empty result set
I am trying to use the WITH clause in a SELECT. Documentation is at https://my.vertica.com/docs/7.0.x/HTML/index.htm#Authoring/ProgrammersGuide/Queries/WITHClausesInSELECT.htm .
My query looks like this.
with_clause_1 AS (SELECT ... ),
with_clause_2 AS (SELECT ... )
FROM with_clause_1, with_clause_2
If both *with_clauses* return values, then the query works fine. However, if one of them do not have any rows (e.g. with_clause_1 returns 0 row), then the result of the whole query returns zero row.
Does anyone know how I can write the query such that rows will always be returned if at least 1 of the clauses return a row? For the clauses that return 0 row, it's ok to return a static value too, so something like NULL is fine to indicate 0 row returned.
Is this a bug with this WITH clause then?