select i.user_id, min(i.date) first_buy_date, b.date second_buy_date, count(*) cnt from order_info i inner join ( select user_id, date, row_number()over(partition by user_id order by date) a from order_info where datediff(date, '2025-10-15') > 0 and product_name in ('C++', 'Java', 'Py...