Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
将 JSON 对象的最外层元素展开为键值对并返回表。
json_each(json_object_expr)
json_object_expr
-- 以一个名为 tj 的表为例。在 tj 表中,j 列是一个 JSON 对象。 mysql> SELECT * FROM tj; +------+------------------+ | id | j | +------+------------------+ | 1 | {"a": 1, "b": 2} | | 3 | {"a": 3} | +------+------------------+ -- 将 tj 表的 j 列按键和值展开为两列,以获得由多行组成的结果集。在此示例中,使用 LATERAL 关键字将结果集与 tj 表连接。 mysql> SELECT * FROM tj, LATERAL json_each(j); +------+------------------+------+-------+ | id | j | key | value | +------+------------------+------+-------+ | 1 | {"a": 1, "b": 2} | a | 1 | | 1 | {"a": 1, "b": 2} | b | 2 | | 3 | {"a": 3} | a | 3 | +------+------------------+------+-------+