Bug #91993 enhance JSON_ARRAYAGG by DISTINCT
Submitted: 13 Aug 2018 10:53 Modified: 21 Nov 2019 13:50
Reporter: Andrej Thomsen Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: JSON Severity:S4 (Feature request)
Version:8.0.12 OS:Any
Assigned to: CPU Architecture:Any
Tags: distinct, json, JSON_ARRAYAGG

[13 Aug 2018 10:53] Andrej Thomsen
Some use-cases of mine require JSON-Arrays without duplicates. Since JSON_ARRAYAGG() can't do that, I often have to use some mixture of GROUP_CONCAT(DISTINCT col) with CONCAT() and then cast it as JSON. It would be great to just add "DISTINCT" into that function, like it is possible in GROUP_CONCAT().

How to repeat:
Use JSON_ARRAYAGG() with a column, which does contain non unique values.
[21 Nov 2019 13:50] MySQL Verification Team
Hi Mr. Thomson,

Thank you for your feature request.

I find your idea a good addition to the described function.

Verified as reported.
[7 Jul 15:32] marcos vinicios pinheiro de sant marcos
Hello, does anyone know if this function has already been implemented in mysql?