How to use SQL to extract values correctly?

Viewed 28

[ { 'id': '630dade1432e5d0019881614', 'item_type': 'Product', 'item_data': { 'cart_item_id': '630dad6ef498a200254b0b55', 'promotion_id': None, 'parent_item_ids': [

  ],
  'triggering_item_id': '',
  'order_promotion_items': {

}

SELECT JSON_EXTRACT(subtotal_items, "$.id") from orders.

I got a json format files, but when I tried to use "json_extract" to extract "id" in that raw data, the results are "null" Do you know what is wrong? Which functions I should use to extract values correctly?

Thank you!

0 Answers
Related