group_concat是否有长度限制,或者它在文本字段上不起作用的其他原因 [英] is there a length limit to group_concat or another reason why it would not work on a text field

查看:187
本文介绍了group_concat是否有长度限制,或者它在文本字段上不起作用的其他原因的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,这是查询:

SELECT GROUP_CONCAT(title) title, GROUP_CONCAT(description) description,
skill_id, count(*)

FROM jobs j
INNER JOIN job_feed_details d
ON j.id = d.job_id
JOIN jobs_skills js
ON j.id = js.job_id
    WHERE moderated = 1
    group by skill_id

除了描述字段仅返回一个结果,而不是所有结果的并置之外,所有操作均按预期进行.我怀疑这是因为描述是一个text字段,但是我找不到关于级联为什么不适用于文本字段的任何信息.

Everything works as expected except the description field only returns one result, instead of a concatenation of all results. I suspect this is because the description is a text field, but I cannot find anything about why concatenation would not work with a text field.

有人知道为什么这行不通吗?

Anyone know why this would not work?

推荐答案

group_concat结果的长度被限制(被截断)为 group_concat_max_len 系统变量的值.此变量的默认值为1024.

The group_concat result length is limited(truncated) to the value of the group_concat_max_len system variable. The default value of this variable is 1024.

如果要更改变量的值,语法为:

If you want change the value of the variable the syntax is:


SET [GLOBAL | SESSION] group_concat_max_len = val;

更多信息 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆