select
ROWKEY,
CASE
WHEN t1.PremiumInclFees IS NOT NULL AND t2.PremiumInclFees IS NOT NULL
THEN t1.PremiumInclFees + t2.PremiumInclFees
WHEN t1.PremiumInclFees IS NULL
THEN t2.PremiumInclFees
WHEN t2.PremiumInclFees IS NULL
THEN t1.PremiumInclFees
ELSE cast(0.0 as double) END flowAmount,
The above case statement is not working. t1 and t2 are two tables used in the query. Can any one guide me on this?