fixed group_by for distinct field name and db_column