@@ -207,13 +207,13 @@ aggregation query:
208 query :: Query_ (Public Schema) () (Sum Int32, P ("col1" ::: Int32))
208 query :: Query_ (Public Schema) () (Sum Int32, P ("col1" ::: Int32))
210− select_ (sum_ (All #col2) `as` #getSum :* #col1)
210+ select_ ((fromNull 0 (sum_ (All #col2))) `as` #getSum :* #col1)
211 ( from (table (#tab `as` #table1))
211 ( from (table (#tab `as` #table1))
212 & groupBy #col1
212 & groupBy #col1
213− & having (#col1 + sum_ (Distinct #col2) .> 1) )
213+ & having (#col1 + (fromNull 0 (sum_ (Distinct #col2))) .> 1) )
214in printSQL query
214in printSQL query
216−SELECT sum(ALL "col2") AS "getSum", "col1" AS "col1" FROM "tab" AS "table1" GROUP BY "col1" HAVING (("col1" + sum(DISTINCT "col2")) > 1)
216+SELECT COALESCE(sum(ALL "col2"), 0) AS "getSum", "col1" AS "col1" FROM "tab" AS "table1" GROUP BY "col1" HAVING (("col1" + COALESCE(sum(DISTINCT "col2"), 0)) > 1)
218sorted query:
218sorted query:
@@ -1021,10 +1021,10 @@ instance With (Query outer) where
1021 `unionAll`
1021 `unionAll`
1022 select_ ((#n + 1) `as` #n)
1022 select_ ((#n + 1) `as` #n)
1023 (from (common #t) & where_ (#n .< 100)) `as` #t )
1023 (from (common #t) & where_ (#n .< 100)) `as` #t )
1024− ( select_ (sum_ (All #n) `as` #getSum) (from (common #t) & groupBy Nil))
1024+ ( select_ (fromNull 0 (sum_ (All #n)) `as` #getSum) (from (common #t) & groupBy Nil))
1025 in printSQL query
1025 in printSQL query
1027−WITH RECURSIVE "t" AS ((SELECT * FROM (VALUES (1)) AS t ("n")) UNION ALL (SELECT ("n" + 1) AS "n" FROM "t" AS "t" WHERE ("n" < 100))) SELECT sum(ALL "n") AS "getSum" FROM "t" AS "t"
1027+WITH RECURSIVE "t" AS ((SELECT * FROM (VALUES (1)) AS t ("n")) UNION ALL (SELECT ("n" + 1) AS "n" FROM "t" AS "t" WHERE ("n" < 100))) SELECT COALESCE(sum(ALL "n"), 0) AS "getSum" FROM "t" AS "t"
1029withRecursive
1029withRecursive
1030 :: Aliased (Query outer (recursive ': commons) schemas params) recursive
1030 :: Aliased (Query outer (recursive ': commons) schemas params) recursive