postgres COALESCE code example
Example 1: postgresql if null then 0
select coalesce(avg(bar), 0) from foo;
Example 2: nvl postgres
COALESCE (argument_1, argument_2, …);Code language: SQL (Structured Query Language) (sql)
select coalesce(avg(bar), 0) from foo;
COALESCE (argument_1, argument_2, …);Code language: SQL (Structured Query Language) (sql)