Write a query to return every row in orders with prev2_amount, the amount two positions earlier in the same customer’s order history, or NULL if no such row exists.
Return prev2_or_zero as the same value with any NULL replaced by 0. Sequence each customer’s orders by order_ts, then order_id, both ascending. Keep every order.
Ordering: Sort by customer_id, then order_ts, then order_id, all ascending.