Subject Re: Sub select paramerter with null value problem (solution)
Author jasajona
SELECT
A.Field1,
sum(A.Field2),
(SELECT sum(B.Field2) FROM B WHERE
(B.Field1 = A.Field1 AND A.Field1 IS NOT NULL) OR
(B.Field1 IS NULL AND A.Field1 IS NULL)
)
FROM A
GROUP BY A.Field1