首页 > 解决方案 > codeigniter 中带有 GROUP_CONCAT 的 SUBSTRING_INDEX 不起作用

问题描述

公共函数 getProductsById($id)
{

    $this->db->select('product.*,SUBSTRING_INDEX(GROUP_CONCAT(product_properties.name), " ", 4) as pname');       
    $this->db->from('product');        
    $this->db->where('product.subcategory_id',$id);                
    $this->db->join('product_properties','product_properties.product_id=product.id');
    $this->db->group_by('product_properties.product_id');
    return @$this->db->get()->result_array();
}

这是我看到的错误

请帮忙!

标签: mysqlsqlcodeigniter

解决方案


推荐阅读