Reputation: 129
IIF(Col1=1, DAT1, IIF(Col2=1, DAT2, IIF(col3=1, DAT3, IIF(Col4=1, DAT4))))
The above is the informatica piece of code
How do i convert this in oracle
case when col1=1 then data1
else
case when col2=1 then data2)
I have tried something like this.But i am not sure .Please suggest me on how to convert
Upvotes: 0
Views: 345
Reputation: 17353
You don't need multiple, nested CASE
statements, one is enough:
CASE
WHEN Col1=1 THEN DAT1
WHEN Col2=1 THEN DAT2
WHEN Col3=1 THEN DAT3
WHEN Col4=1 THEN DAT4
END
Upvotes: 1