获取多个对象中的对象 MYSQL JSON

Get object inside more than one object MYSQL JSON

如何 select "flavor" 对象中的数组“1”来自 json mysql[= 中的代码15=]

属性名称:设置

{"without":{"usd":{"new":"5","old":"8"},"weight":"5"},"color":{"2","3"},"flavor":{"1","2"}}

知道这些对象在第一个对象中并且它们是可变的,我怎样才能在 "usd" 对象中获取 "new" 中的数字,也许是 ["without" 或 "long" 或 ......]

属性名称:设置

{"without":{"usd":{"new":"5","old":"8"},"weight":"5"},"color":{"2","3"},"flavor":{["1","2"}}
{"long":{"usd":{"new":"2","old":"3"},"weight":"2"},"medium":{"usd":{"new":"3","old":"4"},"weight":"3"},"short":{"usd":{"new":"4","old":"5"},"weight":"4"}}
{"short":{"usd":{"new":"4","old":"5"},"weight":"2"},"color":{"1","2"}}

喜欢

without = 5
long = 2
short = 4

我重建了数据格式以便提取所需的数据

{"size":[{"id":1,"url":"without","weight":"5","price":{"usd":{"new":"5","old":"8"}}}],"color":[{"id":"2","url":"yellow"},{"id":"3","url":"green"}],"flavor":[{"id":"1","url":"berry"},{"id":"2","url":"strawberry"}]}

MYSQL

JSON_EXTRACT(details.settings, '$.color[*].url') LIKE '%yellow%'