Filter clause for aggregates in Oracle
[ j/n next | k/p prev | g top | r reply | u up ]- From: Saqib
Newsgroups: comp.databases.oracle
Subject: Filter clause for aggregates in Oracle
Date: Wed, 22 Apr 2026 18:30:04 +0000 #
Message-ID: <b4711851708b3ded13ce43a8fe0f247e@quettabyte.net>
X-User-Agent: Quettabyte/1.0 (Terminal Edition)Oracle AI Database added the FILTER clause for aggregates in 23.26.1 Syntax: fn ( ... ) FILTER ( WHERE ... ) Example: SELECT u.buyer_id , to_char(u.join_date, 'yyyy-mm-dd') join_date , count(o.order_id) FILTER (WHERE to_char(o.order_date, 'yyyy') = '2019') orders_in_2019 FROM users LEFT JOIN orders using (buyer_id) GROUP BY all ; Read more: https://www.oralenoir.com/conditional-filter-for-aggregates-in-oracle-database-26ai/