using group_concat in PHPMYADMIN will show the result as [BLOB - 3B]

前端 未结 7 1311
傲寒
傲寒 2020-12-04 16:43

I have a query which uses the GROUP_CONCAT of mysql on an integer field.
I am using PHPMYADMIN to develop this query. My problem that instead of showing 1,2 which is the

7条回答
  •  生来不讨喜
    2020-12-04 16:58

    According to the MySQL documentation, CAST(expr AS type) is standard SQL and should thus be perferred. Also, you may omit the string length. Therefore, I’d suggest the following:

    SELECT rec_id, GROUP_CONCAT(CAST(user_id AS CHAR))
    FROM t1
    GROUP BY rec_id
    

提交回复
热议问题