SELECT group_concat(specifications separator ',"'), COUNT(1) FROM goods_product WHERE deleted = '0' GROUP BY right(specifications,4)
查询结果:
group_concat 分组字段连接展示函数,默认按‘,’分割
right 分组字段切割分组,只取其中一部分做分组
还有 left substring(xx,index,length) 当index>0从左边开始截取直到结束 当index<0从右边开始截取直到结束 当index=0返回空 length截取长度