GROUP_CONCAT not working for > 283

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rizwan6feb
    New Member
    • Jul 2007
    • 108

    GROUP_CONCAT not working for > 283

    I have created a table (with only 2 fields) with the following query
    Code:
    "CREATE TABLE `users` (
    `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
    `name` VARCHAR( 20 ) NOT NULL
    ) ENGINE = MYISAM ;"
    There are 20,000 users in this table with ids from 1 to 20,000

    On executing the following query
    Code:
    select group_concat(id separator ',') from users
    returns only 283 ids separated with ','
  • rizwan6feb
    New Member
    • Jul 2007
    • 108

    #2
    I have found a solution myself, this is because of a session variable group_concat_ma x_len, which is set to 283, can be changed with
    @@group_concat_ max_len = 9999999;'

    Comment

    • ronverdonk
      Recognized Expert Specialist
      • Jul 2006
      • 4259

      #3
      Good to know. Thank you for this info. Good luck.

      Ronald

      Comment

      Working...