oracle - SQL: AVG with NULL Values -
as far understood avg() function ignores null values.
so avg(4,4,4,4,4,null) --> 4
in case don´t want happen.
i need solution that: avg(4,4,4,4,4,null) --> 3,33
without replacing null values directly in table itself. there way this?
use coalesce()
return real value of 0 null columns:
select avg(coalesce(some_column, 0)) ...
Comments
Post a Comment