SET SESSION group_concat_max_len = 1000000;
SELECT
ROW_NUMBER() OVER (ORDER BY r.rental_date, s.store_id) AS row_number,
r.rental_date AS meet_time,
s.store_id,
GROUP_CONCAT(CONCAT(c.first_name, ' ', c.last_name) ORDER BY c.last_name SEPARATOR ',') AS customers
FROM rental r
JOIN customer c ON r.customer_id = c.customer_id
JOIN staff s ON r.staff_id = s.staff_id
GROUP BY r.rental_date, s.store_id
HAVING COUNT(DISTINCT r.customer_id) > 1
ORDER BY r.rental_date, s.store_id;