mysql group_concat没有带来整个数据

Omn*_*ent 17 mysql sql

我正在使用以下查询并使用该group_concat功能.但是,有时answers列中的数据被切断; 意思是我没有得到整个数据,最后它被切断了.

我怀疑它可能与数据类型有关....它可以被转换为更大的数据类型吗?目前的Other1数据类型是text

 select SiteName, 
case 
when group_concat(Other1) is not null 
  then  group_concat( cast(Other1 AS BLOB)) 
when group_concat(Other1) is null
  then  'No Response provided'
end
 'answers'
from disparities_community_partnerships
where QuarterId=2
group by SiteName
Run Code Online (Sandbox Code Playgroud)

Ric*_*iwi 29

http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat

结果被截断为group_concat_max_len系统变量给出的最大长度,该变量的默认值为1024.尽管返回值的有效最大长度受max_allowed_pa​​cket的值约束,但该值可以设置得更高.在运行时更改group_concat_max_len的值的语法如下,其中val是无符号整数

SET [GLOBAL | SESSION] group_concat_max_len = val;
Run Code Online (Sandbox Code Playgroud)


Lea*_*per 6

还有一个示例示例执行如下

SET GLOBAL  group_concat_max_len = 5555555;
 select SiteName, 
case 
when group_concat(Other1) is not null 
  then  group_concat( cast(Other1 AS BLOB)) 
when group_concat(Other1) is null
  then  'No Response provided'
end
 'answers'
from disparities_community_partnerships
where QuarterId=2
group by SiteName
Run Code Online (Sandbox Code Playgroud)