I’m trying to create a query using a GROUP BY using the DB api used in TestRail in order to support grouped aggregation. There doesn’t seem to be a $db->group_by() mechanism. I’ve worked around it using the following hack:
$this->db->where_expr(‘1=1) GROUP BY (tests.id’);
But that’s horribly ugly. Is there a better way to do it?