Distinct and group by examples