Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8808

Re: isnotnull issue

$
0
0

OK ... mybad ... this is correct because NULL represents unknown data.

 

These sample queries I found in the sql ref guide help:

 

SELECT IFNULL ('diff', 'same') as "ifnull" FROM DUMMY;

you can see here that ‘diff’ is not null so it returns the first value:

ifnull

diff

 

SELECT IFNULL (NULL, 'same') as "ifnull" FROM DUMMY;

You can see here that NULL is null so it returns the second value:

ifnull

same

 

SELECT IFNULL (NULL, NULL) as "ifnull" FROM DUMMY;

You can see here that NULL is NULL so it returns the null value '?':

ifnull

?

 

SELECT IFNULL ('', 'same') as "ifnull" FROM DUMMY;

You can see here that ‘’ is not null so it returns the first value:

ifnull

 

Mike


Viewing all articles
Browse latest Browse all 8808

Trending Articles