Skip to content
Advertisement

How to fix Nested CASE Syntax Error “Invalid Number of Arguments” in Oracle SQL

Im running a query in Oracle and am trying to create a new column that is defined by the nested CASE statement below. I get an error on the highlighted “Else” statement saying “Invalid Number of Arguments”.

I looked it over many times and it seems to have the correct number of arguments. Am i missing something here?

Advertisement

Answer

It seems like you want:

Your code has multiple ELSE clauses against the outer CASE expression, and there can only be one. The first three each have an inner CASE which doesn’t need to be there; the WHEN ... THEN for those can be ‘promoted’ to the outer expression.

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