create index ORDERS_BY_USER on ORDERS(USER_ID) local;
✓
✓
hidden batch(es)
explain plan for
select order_month,sum(amount),count(*)
from
(
select trunc(ORDER_DATE,'month') order_month, USER_ID, AMOUNT
from ORDERS join USERS using(USER_ID)
) user_orders
where USER_ID=42
group by order_month
;