Mysql从数组中选择元素
在我的表中,名为Mysql从数组中选择元素,mysql,sql,ruby-on-rails,Mysql,Sql,Ruby On Rails,在我的表中,名为images的列存储为 [{:media_type=>"IMAGE", :name=>nil, :thumbnails=> {:small=>"small.png", :medium=>nil, }, {:media_type=>"IMAGE", :name=>nil, :thumbnails=> {:small=>&
images
的列存储为
[{:media_type=>"IMAGE",
:name=>nil,
:thumbnails=>
{:small=>"small.png",
:medium=>nil,
},
{:media_type=>"IMAGE",
:name=>nil,
:thumbnails=>
{:small=>"small1.png",
:medium=>nil,
}} .. and others elements]
所以我想选择它的方式喜欢它
images[0].thumbnails.small as pdf
images[1].thumbnails.small as jpg
我已经尝试过使用JSON\u CONTAINS
来实现它,这与我想要的非常相似
但是没有运气
有什么办法吗