2016年5月31日

pgsql 查询jsonb中包含某个键值对的表记录

摘要: SELECT * FROM table_name WHERE (SELECT * FROM jsonb_array_elements_text(combos) AS ab WHERE (ab::json->>'id') = '1001') is not null; 阅读全文
posted @ 2016-05-31 16:41 mywebnumber 阅读(4946) 评论(0) 推荐(0) 编辑

php 键值数组搜索查询

摘要: php 键值数组查询 ,需要先将其转换为纯数组,然后才能用in_array 进行搜索。$arr_combos = [ ['id' => '1001', 'value' => 'zs' ], ['id' => '1002', 'value' => 'ls' ] ] echo in_array('100 阅读全文
posted @ 2016-05-31 16:10 mywebnumber 阅读(1210) 评论(0) 推荐(0) 编辑