postgreSQL中函数json_populate_recordset的参数null::myrowtype
发布时间:2020-12-13 17:06:40 所属栏目:百科 来源:网络整理
导读:postgreSQL可以对json数据进行操作,其中json_populate_recordset()函数可以将json数据转化为表,说明文档中该函数参数如下: son_populate_recordset(base anyelement,from_json json) jsonb_populate_recordset(base anyelement,from_json jsonb) setof an
postgreSQL可以对json数据进行操作,其中json_populate_recordset()函数可以将json数据转化为表,说明文档中该函数参数如下:
select * from json_populate_recordset(null::"poiarray",'[{"distance":"42","direction":"East","tel":"0731-88876770","name":"中南大学北校区出版社","weight":"0.0","typecode":"141105","longitude":"112.932278","address":"麓山南路932 号中南大学","latitude":"28.169033","type":"科教文化服务;传媒机构;出版社","poiid":"B02DB05LP4"},{"distance":"155","direction":"SouthEast","tel":"","name":"中国银行(中南大学支行)","typecode":"160104","longitude":"112.932647","address":"中南大学六食堂后侧","latitude":"28.167892","type":"金融保险服务;银行;中国银行","poiid":"B02DB0UM9V"},{"distance":"102","direction":"West","name":"矿冶园","typecode":"110100","longitude":"112.930803","address":"麓山南路932号中南大学","latitude":"28.169026","type":"风景名胜;公园广场;公园广场","poiid":"B0FFFZ13U8"},{"distance":"196","direction":"SouthWest","name":"中南大学北校区商学院","typecode":"141201","longitude":"112.93034","latitude":"28.167933","type":"科教文化服务;学校;高等院校","poiid":"B02DB104AT"},{"distance":"126","name":"中南大学北校区地球科学与信息物理学院","longitude":"112.930726","latitude":"28.168536","poiid":"B02DB107ER"}]'); 对于null::"poiarray"参数,表poiarray必须存在,其结构与json数据相对应,即 create table poiarray( distance varchar,direction varchar,tel varchar,name varchar,weight varchar,typecode varchar,longitude varchar,address varchar,latitude varchar,type varchar,poiid varchar );执行结果如下
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- c# – 如何使用async / await与使用基于事件的异步模式的库
- RTMP协议发布H264 + AAC的实时流媒体,可以用FLASH直接播放
- ruby-on-rails – 如何在rails应用程序中覆盖gem的类方法?
- cef加载flash弹出黑框问题
- Oracle DataGuard学习笔记(3)物理Standby主从角色切换
- Flex4.5+Myeclipse8.5安装
- postgresql – Postgres String to Date示例10Apr77至10/04
- CockroachDB 1.1发布 平均延迟下降到5ms,数据恢复速度提升
- c# – 应该在代码中还是在数据库中处理NULLS?的优点和缺点
- C#WebClient OpenRead网址