like I said, you have *a different question* than others.
the original poster wanted
a) count of non-null values of value_x from table_a
b) count of distinct non-null values of value_x from table_b
added together. That is:
select sum(cnt)
from (select count(value_x) cnt from table_a
UNION ALL
select count(distinct value_x) frmo table_b
)
Later, I answered that same question differently:
select count(*)
from (select null from table_a where value_x is not null
union all
select distinct value_x from table_b where value_x is not null);
there union would get the WRONG answer given the question asked...
You quite simply had a different question - so the answers provided previously are not *wrong*, they just are not the answers to YOUR question.