Skip to content
Advertisement

How to SUM multiple DECODE values?

I have the following decodes in my SELECT case:

I want to add up those 3 values (every DECODE has always some results) but I can’t. When I write a simple

I don’t even see any result. Does anyone know where my mistake is?

Advertisement

Answer

Actually, should have probably been vice versa: SUM(DECODE), not DECODE(SUM), e.g.

NVL function might need to be used.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement