mysql - 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();
}
请帮忙!
解决方案
推荐阅读
- eclipse - Spring Boot 在 Eclipse 中使用 log4j2 - NoClassDefFoundError Logback
- c - 没有编译错误,但在 C 中没有得到任何输出
- javascript - 确定具有指定面对模式的相机的设备ID
- c# - 如何解决无效视图状态的问题
- java - 我无法决定为我想要实现的目标存储字符串的最佳方式
- .net-core - 尝试使用通用 HostBuilder 使用 .net core 2 控制台应用程序配置 Serilog
- office-js - 从清单命令 (IE11/Edge) 调用时,window.addEventListener 在 Word 加载项中不起作用
- jquery - 如何仅删除所选元素中的一个元素,留下另一个?
- visual-studio - Azure Build Pipeline:构建解决方案依赖项失败 - 找不到包但独立构建 csproj 依赖项文件可以正常工作
- sonos - 刷新的身份验证令牌不持久