postgresql技巧

来源:互联网 发布:淘宝付款截图生成器 编辑:程序博客网 时间:2024/05/10 14:55

自定义多行

select unnest(array[1,2,3])

正则

select * from test where name ~ '[\[,]111[\],]'

json

select  '[1,2,3]'::json->2select  '{"a":1,"b":2}'::json->'b'select  '[1,2,3]'::json->>2select  '{"a":1,"b":2}'::json->>'b'select  '{"a":[1,2,3],"b":[4,5,6]}'::json#>'{a,2}'select  '{"a":[1,2,3],"b":[4,5,6]}'::json#>>'{a,2}'
原创粉丝点击