with rowrank as ( select *, count(id) over(partition by user_id) as tcount, row_number() over(partition by user_id) as trank from order_info where product_name in ('C++','Python','Java') and status = 'completed' and date > '2025-10-15' ) select rowrank.id, rowrank.is_group_buy, client.name as client_name from rowrank left join client on rowrank.client_id = client.id where rowrank.tcount >= 2 order by rowrank.id asc;