I have a column in a SQLite table , it is a json array, how can I select unique elements in the column?

The values of the column like “[‘a’, ‘b’]”, “[‘a’]”, “[‘c’, ‘a’]”

SELECT DISTINCT value AS unique_element
FROM your_table,
     json_each(json_column);

json_each(json_column): This function is used to expand the JSON array into a set of key-value pairs, where the key is the index or key within the array, and the value is the corresponding element. So that for each record of you_table, it will expand to n records if json_column has n elements. To see the expansion

SELECT key, value, your_table.*
FROM your_table,
     json_each(json_column);