postgresql if null then 0
snippet in sql

postgresql if null then 0

user4967

select coalesce(avg(bar), 0) from foo;