What is the `FILTER (WHERE condition)` clause used with aggregate functions?

Advanced SQL Developer Medium

Advanced SQL Developer — Medium

What is the `FILTER (WHERE condition)` clause used with aggregate functions?

Key points

  • `FILTER (WHERE condition)` is used with aggregate functions to selectively include rows in calculations.
  • It does not replace the WHERE clause or HAVING clause, but provides a more targeted filtering option.
  • This clause is particularly useful when you need to calculate different aggregates based on different conditions in the same query.

Ready to go further?

Related questions