ISNULL returns 0 for a hardcoded column with a NULL value

Why does this operator return 0 instead of an empty string? I actually use a view that selects an operator in contact with hardcoded column return NULL. Although I am trying to check if its NULL, it actually returns 0.

SELECT ISNULL((SELECT NULL as Col), '')

Any suggestion or help would be appreciated ...

snapshot

+4
source share
1 answer

NULL , SELECT NULL int. , int char(N), int, char(N) int, . , '' int - , - 0.

SELECT ISNULL((SELECT CAST(NULL AS char(1)) AS col), '') .

+5

Source: https://habr.com/ru/post/1611898/


All Articles