首页 > 代码库 > 提取postgresql数据库中jsonb列的数据

提取postgresql数据库中jsonb列的数据

SELECT t.* FROM person, jsonb_to_record(info) AS t(num text, name text, score text) WHERE person.id=1;SELECT t.errmsg,sms_records.*  FROM sms_records, jsonb_to_record(result_json) AS t(errmsg text,sid text)select tb_result.errmsg,* from ( select t1.*,t2.account_type,t2.account_name ,t3.report_status,t3.errmsg,t3.user_receive_time,t3.description from sms_records t1 left join accounts t2 on t1.account_id = t2.id left join sms_status t3 on t1.sid = t3.sid ) t, jsonb_to_record(result_json) AS tb_result(errmsg text,sid text)where 1=1

 

提取postgresql数据库中jsonb列的数据