EasyWHERE & Filtering

Find all orders NOT in pending or cancelled status

The query

SQL
SELECT order_id, cust_id, total, status
FROM orders
WHERE status NOT IN ('pending', 'cancelled')
ORDER BY order_date DESC;
Tested against PostgreSQL 16

Note

NOT IN excludes listed values. Careful: NOT IN with NULLs in the list returns no rows.

Tables referenced