如何在Codeigniter中选择分组所选名称的最后一个ID?

function retrieve_income_types(){
    $this->db->where('active','1');
            $this->db->group_by('Income_Type_Name');        
            $this->db->order_by('Income_Type_ID', 'desc');
    return $this->db->get('Income_Types')->result();
}

this is my model it returns the smallest id of grouped names