Oscar Wos
Oscar Wos

Reputation: 1

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.

Image

I'd like to know if there's a limit for any of the functions I used; and if it can be fixed.

Upvotes: 0

Views: 532

Answers (1)

Bernd Buffen
Bernd Buffen

Reputation: 15057

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;

Upvotes: 2

Related Questions