Skip to Content
0
Jan 03, 2023 at 03:15 AM

SAP HANA SQL Script where null = null not work.

238 Views Last edit Jan 03, 2023 at 03:16 AM 3 rev

Hi expert,

image.png

[1]

select tab1."BUKRS", tab1."AMT", tab2."AMT" from tab1 left join tab2

on tab1."BUKRS" = tab2."BUKRS";

The result is 1000 300 5000.

[2]

But, if field "ACCT", which is NULL, is added to where condition, e.g,

select tab1."BUKRS", tab1."AMT", tab2."AMT" from tab1 left join tab2

on tab1."BUKRS" = tab2."BUKRS" and tab1."ACCT" = tab2."ACCT";


The result is 1000 300 NULL.

The value of tab2."AMT"(5000) is not fetched.

[3]

So , my question is:

Fields which are NULL, can not be used in where condition ?

Tks.

Attachments

image.png (3.5 kB)