sql查询json格式中的内容

sale_property_values是一个json字段。想要获取该json数组中,key名字为stringValue对应的值
SELECT id,json_extract_path_text(json_array_elements(sale_property_values),'stringValue') FROM ic_sku where id = 1

sql查询json格式中的内容

 

 

 SELECT DISTINCT
t1.NAME,
t3.sku_code,
t4.ean_code,
json_extract_path_text ( json_array_elements ( t3.sale_property_values ), 'stringValue' ) AS 规格
FROM
ic_item t1,
ic_item_sku t2,
ic_sku t3,
ic_sku_price t4
WHERE
t1.ID = t2.item_id
AND t2.sku_id = t3.ID
AND t3.ID = t4.sku_id
AND t1.deleted = FALSE
AND t2.deleted = FALSE
AND t3.deleted = FALSE
AND t4.deleted = FALSE

相关文章:

  • 2021-12-09
  • 2021-07-10
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-02
  • 2022-12-23
  • 2022-12-23
  • 2021-08-06
  • 2021-06-19
  • 2021-04-01
相关资源
相似解决方案