Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql从数组中选择元素_Mysql_Sql_Ruby On Rails - Fatal编程技术网

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
来实现它,这与我想要的非常相似 但是没有运气

有什么办法吗