cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

HANA IFNULL FUNCTION DOUBT

former_member280546
Participant
0 Likes
9,372

I don't know if I understand the IFNULL function correctly but it seems that it is not working properly.

Here is my select statement:

SELECT LIFNR,IFNULL(STCD1,STCD2),STCD1,STCD2 FROM LFA1 WHERE "LIFNR" = '0009009005'

I would like to return the STCD2 value if STCD1 is null. In this sample the STCD1 is null and the function is not returning STCD2.

Am I missing anything?

Syntax

 IFNULL (expression1, expression2)

Description

Returns the first not NULL input expression.

  • Returns expression1 if expression1 is not NULL.
  • Returns expression2 if expression1 is NULL.
  • Returns NULL if both input expressions are NULL.

regards,

Filipe

View Entire Topic
former_member280546
Participant

Once the column STD1 is flagged as "NOTNULL" the actual value in it is empty not null. That's the reason why the function is not working in this case.