当前位置: 动力学知识库 > 问答 > 编程问答 >

mysql - Selecting information_schema.columns is only returning the first 1025 characters. Why?

问题描述:

When I run the query below, I only get half my column names surrounded by single quotes(which was exactly 1025 characters). I using Sequel Pro's query execution window. I have tried to type cast @columnNames. No luck.

select group_concat(concat("'",column_name, "'")) into @columnNames

from information_schema.columns

where [email protected];

Because I have to know..... :)

网友答案:

Change the value of the group_concat_max_len server variable, which by default is 1024, prior to executing your query.

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
分享给朋友:
您可能感兴趣的文章:
随机阅读: