I have table like this my_table
id my_json
1 ['1','2','3']
2 ['2']
3 ['2','3']
...
12000 ....
I want to find all distinct values in json's arrays like this result '1' '2' '3'
I have this code but i need split values to rows
set @items = (SELECT
GROUP_CONCAT(
REPLACE(REPLACE(lower(my_json), ']', ''), '[', '')
SEPARATOR ','
)
FROM my_table);
SELECT CONCAT ('[',@items,']') AS jarray;
result is
[1,2,3]
probably somebody have ideas?