Fixed the SQL query to not group by lastname