Din forespørgsel er lidt mærkelig.
vælg navn, GROUP_CONCAT(DISTINCT(id) SEPARATOR "-") AS id FROM ( (vælg "APN" SOM navn, GROUP_CONCAT(DISTINCT(site.id) SEPARATOR "-") AS id fra site WHERE id IN (138,147,8918,8916,9033,9240,97,9038,8886,9036,9067,146,37,9127,52,9031,23,8635,8665,46,339,918, ,9051,8766,25,20,9160,133,8636,9021,8655,21,42,8757,22,9017,77,9037,44,49,9323,55,74,150,8,627, ,58,9025,9221,9019,9069,9214,9176,95,40,9335,168,9260,8641,9227,9258,24,50,29,9073,12,36,88382,9, ,9032,51,9060,96,8922,9212,14,9095,28,9213,31,41,68,9027,8884,9023,9059,9034,9016,11,61,9229,276,9819,276,9819,276 ,9018,9121,9119,8659,8926,9096,57,9083,8662,9232,149,8643,88,19,8660,10,8936,9210,9241,17,8872 (se UNIONs ALL) " AS-navn, GROUP_CONCAT(DISTINCT(site.id) SEPARATOR "-") AS id fra site WHERE id IN (9129,8981,9136,9169,9170,9171,9172,9297,9147,9155,9139,91428 ,9296,8987,9216,9252,9320,8951,8945,8952,8965,8963,9012,9192,8938,8941,8968,8977,9117,9135,95149,899,9135,95149,899,8938,8941,8968,8977,9117,9135,95149,899,9514,89 8989,8992,9164,9156,9165,9168,9173,8953,8999,8939,8940,8942,8943,8954,8956,8957,8959,8960,87964,8918,8929,8960,87189,8929,8929,8929,8929,8960,87189,8929,8929,8960,87189,8959,8960,87964,87964,8929,8929,8959,8957,8959,8960,87964,87964,87964,8929,8929,8964,8918,8964,8964,8959,8957,8959,8960. 9001,9003,8950,8978,8979,8983,9002,9005,8984,8955,8986,8980,8993,9008,9010,8949,8998,9150,941449,801448,8049,8049,809,94124,809,8993,9008,9010,8949,8998,9150,941449,801448,8049,8049,809,809 9128,9215,9321,9011,9154,8970,8975,8994,9070,8966,8958,9007,9014))) t GROUP BY navn;
er lig med:
(vælg "APN" AS navn, GROUP_CONCAT(DISTINCT(site.id) SEPARATOR "-") AS id fra site WHERE id IN (138,147,8918,8916,9033,9240,97,9038,8886 ,9036,9067,146,37,9127,52,9031,23,8635,8665,46,39,18,33,9035,137,9051,8766,25,20,9160,133,85136,650,133,82636,65 ,21,42,8757,22,9017,77,9037,44,49,9323,55,74,150,8,67,1,8928,58,9025,9221,9019,9069,9214,91406,95 ,9335,168,9260,8641,9227,9258,24,50,29,9073,12,36,8882,9,43,76,9032,51,9060,96,8922,9212,14,8095 ,9213,31,41,68,9027,8884,9023,9059,9034,9016,11,61,9229,8761,9225,8937,9018,9121,9119,8659,89025,8659,89025,869,8963,69 ,9232,149,8643,88,19,8660,10,8936,9210,9241,17,8872)) UNION ALL (vælg "smart" SOM navn, GROUP_CONCAT(DISTINCT(site.id) SEPARATOR "-") AS id fra webstedet WHERE id IN (9129,8981,9136,9169,9170,9171,9172,9297,9147,9155,9139,9138,9142,9296,8987,9216,92052,8952,92052,8952,8952,8952,8952,8952,8952,8952,8952,8952,8952,8952,8952,92052,8952,8987,9216,92052,8952,8952,8952,8987,9216,92052,8959 ,8963,9012,9192,8938,8941,8968,8977,9117,9135,9140,9143,9295,9298,9137,8988,8989,8992,9164,96156,8991,9164,96159,8991,8915,9164,96159,8991,9159,8992,9164,96159,8991,9159,8989 ,8940,8942,8943,8954,8956 ,8957,8959,8960,8964,8971,8972,8973,8974,8982,9000,9001,9003,8950,8978,8979,8983,9002,9005,85989,8005,85989,8005,85989,8005,85989,8005,85989,8009,8005,85989,8009,8005,85989,8909,8005,85989,8009 ,8949,8998,9150,9122,8944,8946,8948,9006,9009,9013,9128,9215,9321,9011,9154,8970,8975,8994,96070,9894,8970,8975,8994,96070,9594,8975,8994,96070,9 kode>
Intet behov for forældregruppering efter navn og id, medmindre din oprindelige forespørgsel producerer mange APN-rækker med samme gruppe af ID'er.
tilbage til dit spørgsmål :Du har ret i, at group_concat har maks. længde på 1024, men en sort /union operation afkortes yderligere til 1/3 (1024/3 =341). (selvom det er kendt, men intet officielt dokument er tilgængeligt til at sikkerhedskopiere dette)
I dit tilfælde skal du bare øge værdien for gruppens konkat maks. længde:
SET group_concat_max_len =5000;
og det burde give dit ønskede output uden at afkorte.
Du kan oprette midlertidige tabeller og forbinde dem, eller du kan udskrive grou_concat-resultatet til en variabel. På begge måder vil grop_concat afkortes med sin oprindelige standardværdi.