Fix the group by constraint in get_results