@bezumkin This is needed because it is only legal in MySQL to have a group by clause that does not include every selected field. Standard SQL does not allow this.