cancel
Showing results for 
Search instead for 
Did you mean: 

HANA Null values and ''

chinabba_lc
Explorer
0 Kudos

Hi,

could you please clarify me on the following?

--NULL and NOT
Select ID, "Null Demo" , Length ("Null Demo" )
FROM (
SELECT 'NULL' ID, TO_CHAR(NULL) "Null Demo" 
FROM DUMMY
UNION
SELECT 'CHAR' ID, TO_CHAR('') "Null Demo" 
FROM DUMMY)
;
 

null-values.png

I thought NULL or a string literal are same '' .

But if I do WHERE "Null Demo" IS NULL then I am getting only the first row.

What is the difference between NULL and ''.

Kindly explain.

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor

No, NULL and a blank are not the same. If you search for the term NULL, than you will find a lot of explanations. The easiest one ist that Null is the "absence of a value e.g. in a certain field", or that no value exists for the field. Instead a '' is a known value.

Answers (0)