Convert JSON array in MySQL to rows

后端 未结 7 1432
无人共我
无人共我 2020-12-01 13:41

UPDATE: This is now possible in MySQL 8 via the JSON_TABLE function: https://dev.mysql.com/doc/refman/8.0/en/json-table-functions.html

I\'m loving t

7条回答
  •  难免孤独
    2020-12-01 14:21

    simple example:

    select subtotal, sku
    from t1,
         json_table(t1.refund_line_items,
                    '$[*]' columns (
                        subtotal double path '$.subtotal',
                        sku char(50) path '$.line_item.sku'
                        )
             ) refunds
    

提交回复
热议问题