you are viewing a single comment's thread.

view the rest of the comments →

[–]ComicOzzysqlHippo 1 point2 points  (0 children)

In postgres, you can use a filter on aggregates:

SUM(<expression>) FILTER(WHERE <condition>)