PostgreSQL - Aggregate Functions and GROUP BY
Given the table
orders with columns customer_id, status, and amount, what will the following query return?SELECT customer_id,
SUM(amount) FILTER (WHERE status = 'shipped') AS shipped_total,
SUM(amount) FILTER (WHERE status = 'pending') AS pending_total
FROM orders
GROUP BY customer_id;