It's a little bit hard to explain so I will explain by giving example,
Let say I have table like this (tags is json column)
+----+-------------------+--------------------+
| id | occupation | tags |
+----+-------------------+--------------------+
| 1 | Mold Maker | [Men, Shop, Shoes] |
| 2 | Software Engineer | [Men, Lifestyle] |
| 3 | Electrician | [Shop, Lifestyle] |
| 4 | Software Engineer | [Men, Lifestyle] |
| 5 | Software Engineer | [Shoes] |
+----+-------------------+--------------------+
When I want to get unique value of occupation I simply just query like this.
SELECT DISTINCT occupation FROM customers;
OR
SELECT occupation FROM customers GROUP BY occupation;
result
+-------------------+
| occupation |
+-------------------+
| Mold Maker |
| Software Engineer |
| Electrician |
+-------------------+
I want unique values of tags by rows like below
+-----------+
| tags |
+-----------+
| Men |
| Shop |
| Shoes |
| Lifestyle |
+-----------+
so far I try to read all JSON_* funcions and JSON_TABLE in MySQL manual and google, but can't find a way to do that, is there anyway around to get the result I want.