Hello Everybody,
I am trying to get a count of all null values v/s non null values in a table. I am trying to use the CASE statement to do this.
I have formed the following SQL so far.
SELECT count(Aj.Asset_Hdr_Id),
CASE Nvl(Aj.Asset_Hdr_Id,
0)
WHEN 0 THEN
'IS NULL'
ELSE
'IS NOT NULL'
END
FROM Asset_Jt Aj
GROUP BY Nvl(Aj.Asset_Hdr_Id, 0);
This is not giving me the desired result. My desired result will look like
2089 IS NULL
12340 IS NOT NULL
I am getting a result that looks like this
1 0 IS NULL
2 1 IS NOT NULL
3 1 IS NOT NULL
4 1 IS NOT NULL
5 1 IS NOT NULL