Help me in solving SQLP15 problem

My issue

Wanted to understand that how the below solution gives only one record per complaint id, even though there are multiple status tagged to the complaint_id:

SELECT DISTINCT cs.complaint_id, uc.user_id, cs.status, MAX(cs.updated)

FROM user_complaints uc
RIGHT JOIN complaint_status cs
ON cs.complaint_id = uc.complaint_id
GROUP BY cs.complaint_id;

My code


SELECT DISTINCT cs.complaint_id, uc.user_id, cs.status, MAX(cs.updated)

FROM user_complaints uc
RIGHT JOIN complaint_status cs
ON cs.complaint_id = uc.complaint_id
GROUP BY cs.complaint_id;

Learning course: SQL: Topic-wise practice
Problem Link: Case Study - ABC Cab-booking App Practice Problem in - CodeChef