--TEST-- Query with select, group, having, order --FILE-- from('user') ->select(null) ->select('type, count(id) AS type_count') ->where('id > ?', 1) ->groupBy('type') ->having('type_count > ?', 1) ->orderBy('name'); echo $query->getQuery() . "\n"; ?> --EXPECTF-- SELECT type, count(id) AS type_count FROM user WHERE id > ? GROUP BY type HAVING type_count > ? ORDER BY name