on ‎2017 May 22 7:39 PM
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?
IFNULL (expression1, expression2)
Returns the first not NULL input expression.
regards,
Filipe
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.