【问题标题】:Change type / len of a user defined column in My SQL Workbench在 My SQL Workbench 中更改用户定义列的类型/长度
【发布时间】:2021-10-26 19:23:27
【问题描述】:

我在 Workbench 中使用 MySQL 查询,它使用 group_concat() 对多个字符串值进行分组。

select group_concat(iba.name, '   ' separator "--") as Entity_Business_Activity 
from entity_business_activities ent_eba
left join entities ent on ent.entity_id = ent_eba.entity_id # for entity Business Activity
left join industries ent_ind on ent_eba.industry_id = ent_ind.industry_id # Needs a group concat
left join industry_business_activities iba on ent_eba.industry_business_activity_id = iba.industry_business_activity_id #(need to be group concat)
where ent.entity_id = 600
group by ent.entity_id;

这是一个示例输出。

我在这里面临的问题是分组字符串值太长,有时会增加 2000 个字符。但是只提取了 1024 个字符,其余的都被跳过了。

有什么方法可以设置此自定义列的类型或增加字符长度吗?

【问题讨论】:

    标签: mysql mysql-workbench query-string


    【解决方案1】:
    SET group_concat_max_len = 10000;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-08-19
      • 2012-07-05
      • 2021-11-14
      • 1970-01-01
      • 2014-11-21
      • 2018-05-08
      • 1970-01-01
      相关资源
      最近更新 更多