简体   繁体   中英

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.

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.

图片

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:

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;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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