如何从数据库中获取“Product”的多个值?

In the below code I am trying to find Minimum rate using MIN(rate), Maximum rate using MAX(rate), and Average Value of rate using AVG(rate) what I get is the Product for MIN(rate) | MAX(rate) | AVG(rate) is same result

    $this->db->select('MIN(rate),MAX(rate),AVG(rate)');
    $this->db->select('my_rates.product');
    $this->db->from('my_rates');
    $query = $this->db->get();
    return $query->result_array();

how to get MIN(rate) Product MAX(rate) Product AVG(rate) Separate

I suggest the following:

$query = $this->db->select('product, MIN(rate) as min, MAX(rate) as max, AVG(rate) as avg', FALSE)
    ->get('my_rates');
return $query->result_array();

The minimum value will be accessible with the key min, the maximum value with the key max, the average with the key avg and my_rates.product with the key product.

CodeIgniter's query builder is really good documented here