在Oracle中,FILTER函数的语法如下:
FILTER (aggregate_function(expression), WHERE condition)
参数说明:
例如,使用FILTER函数计算销售订单中已完成的订单数量:
SELECT COUNT(order_id) FILTER(WHERE status = 'Completed') AS completed_orders FROM orders;