gpt4 book ai didi

mysql - 选择 information_schema.columns 仅返回前 1025 个字符。为什么?

转载 作者:行者123 更新时间:2023-11-29 13:28:22 27 4
gpt4 key购买 nike

当我运行下面的查询时,我只得到一半的列名用单引号括起来(正好是 1025 个字符)。我使用 Sequel Pro 的查询执行窗口。我尝试输入cast @columnNames。没有运气。

select group_concat(concat("'",column_name, "'")) into @columnNames 
from information_schema.columns
where table_name=@tableName;

因为我必须知道......:)

最佳答案

更改 group_concat_max_len 的值在执行查询之前,服务器变量默认为 1024。

group_concat_max_len
The maximum permitted result length in bytes for the GROUP_CONCAT() function.
The default is 1024.

SET SESSION group_concat_max_len = 1000000; -- or any other appropriate value

关于mysql - 选择 information_schema.columns 仅返回前 1025 个字符。为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19825491/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com