Counting null values as unique value
select count(distinct col1) + count(distinct case when col1 is null then 1 end)
from YourTable
select
count(0)
from
(
select distinct hour from hours
)
SqlFiddle
SELECT
( SELECT COUNT(DISTINCT hour)
FROM hours
)
+ CASE WHEN EXISTS
( SELECT *
FROM hours
WHERE hour IS NULL
)
THEN 1
ELSE 0
END
AS result
FROM dual ;
if hour is a number, then if it can only be an integer:
select count(distinct coalesce(hour, 0.1)) cnt from test;
otherwise if it can be any floating point, change NULL to a char string.
eg
select count(distinct coalesce(to_char(hour), 'a')) cnt from test;