简体   繁体   English

MySQL-FIND_IN_SET,GROUP_CONCAT问题

[英]MySQL - FIND_IN_SET , GROUP_CONCAT Problems

I'm having an issue with a query I wrote for a plugin I developed for CS:GO. 我为为CS:GO开发的插件编写的查询存在问题。

I'm using the following query: 我正在使用以下查询:

SELECT FIND_IN_SET(total, (SELECT GROUP_CONCAT(total ORDER BY total DESC) FROM t_cache WHERE total != 0)) AS rank, steamID, total FROM t_cache

As shown in the image below, it only processes the first 129 people, and fails to FIND_IN_SET the rest of the users where the points != 0. 如下图所示,它仅处理前129个人,而对要点!= 0的其余用户则无法FIND_IN_SET

图片

I'd like to know if there's a limit for any of the functions I used; 我想知道我使用的任何功能是否有限制; and if it can be fixed. 以及是否可以修复。

You can increase the max length of the function GROUP_CONCAT with: 您可以使用以下方法增加函数GROUP_CONCAT的最大长度:

Change group_concat_max_len in the /etc/my.cnf

OR only for this session 或仅针对此会话

SET SESSION group_concat_max_len = 1000000;

OR Global for all 或全球通用

SET GLOBAL group_concat_max_len = 1000000;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM