Consider the sql bellow:
select sum(cc.qlnm) as qlnm
FROM
outerjoin_A
left join (SELECT
outerjoin_B.b,
coalesce(outerjoin_C.c, 0) AS qlnm
FROM
outerjoin_B
inner JOIN outerjoin_C ON outerjoin_B.b = outerjoin_C.c
) cc on outerjoin_A.a = cc.b
group by outerjoin_A.a;
The coalesce(outerjoin_C.c, 0) was calculated in the agg node, which is wrong.
This pr correct this, and the expr is calculated in the inner join node now.
27 lines
274 B
Plaintext
27 lines
274 B
Plaintext
-- This file is automatically generated. You should know what you did if you want to edit this
|
|
-- !join1 --
|
|
0
|
|
1
|
|
9999
|
|
|
|
-- !join2 --
|
|
0 1 9999
|
|
|
|
-- !join3 --
|
|
53 \N \N
|
|
|
|
-- !join4 --
|
|
53 \N \N
|
|
|
|
-- !join5 --
|
|
A p 2 -1
|
|
B q 0 -1
|
|
C \N \N \N
|
|
|
|
-- !join5 --
|
|
1 1 1 1
|
|
|
|
-- !join6 --
|
|
1 1 1 1
|
|
|