It seems unsupported to call functions from within the FROM clause. Working example for SQLite:
SELECTone.name, group_concat(j.value, ', ') FROM one, json_each(one.stringArray) AS j GROUP BYone.id
Table one:
CREATETABLEone (
id INTEGERPRIMARY KEY AUTOINCREMENT,
name TEXT,
stringArray TEXTCHECK(json_valid(stringArray))
)
Data:
INSERT INTO"one" ("id", "name", "stringArray") VALUES ('1', 'John Doe', '["apple","banana","cherry"]');
INSERT INTO"one" ("id", "name", "stringArray") VALUES ('2', 'Alice Smith', '["banana","grape","cherry"]');
INSERT INTO"one" ("id", "name", "stringArray") VALUES ('3', 'Bob Johnson', '["banana","apple","grape"]');Update 1: also does not work with the json_table function supported by MySQL (see https://dev.mysql.com/blog-archive/json_table-the-best-of-both-worlds/):
SELECT people.*FROM t1, JSON_TABLE(json_col, '$.people[*]' COLUMNS (
name VARCHAR(40) PATH'$.name',
address VARCHAR(100) PATH'$.address')
) people;
It seems unsupported to call functions from within the FROM clause. Working example for SQLite:
Table
one:Data:
Update 1: also does not work with the
json_tablefunction supported by MySQL (see https://dev.mysql.com/blog-archive/json_table-the-best-of-both-worlds/):