MySQL group_concat_max_len in a query

后端 未结 5 1369
春和景丽
春和景丽 2021-02-05 16:27

I\'m searching a way to insert this

SET GLOBAL group_concat_max_len=15000

in an existing SQL query such as the following:

SELECT *         


        
5条回答
  •  孤独总比滥情好
    2021-02-05 16:40

    You can't use a SET statement inside an expression like you're doing, or even in a subquery. Execute the SET in one statement by itself. The value you set will affect subsequent statements.

    By the way, are you aware that SET GLOBAL means the setting will affect all other MySQL connections on your server, and the setting will even persist after your current session is done, until you set it to something else? You might want to use SET SESSION if you only want the value to affect your current session.

提交回复
热议问题