Reputation: 9635
I have a view
matches_view
returning the following:
id | name | wins | losses | matches
----+----------------+------+--------+---------
2 | Peter | 1 | 2 | 3
1 | Kevin | 3 | 1 | 4
3 | John | | 1 |
How can I replace the empty columns in the last row with 0s in postgreSQL?
Upvotes: 4
Views: 1960
Reputation: 656814
You can use COALESCE(<expression>, 0)
for numeric columns in any case.
Upvotes: 4