我需要有关如何在
MySQL中解析JSON数据的帮助.
我可以解析名为config的列,其中包含以下数据:
{"encounterId":"f45bf821-98e1-4496-82ef-047971e168cb","providerId":"38001853-d2e1-4361-9fff-cfca1aedf406","patientId":"f4d04edb-652f-427c-ac25-6fecbda2a0aa","obs":[{"conceptId":"4e903795-ad79-48fc-851e-9e67c9628e6b","value":0.0},{"conceptId":"5300c3e4-3b53-4a0b-874b-3060d18cec9b","value":"Q"},{"conceptId":"dded4485-6160-4791-a13d-16c87f5004dc","value":"000019"},{"conceptId":"4e503f63-caa0-419a-8670-112441d228da","value":"girl"}],"dateCreated":"Dec 5, 2012 9:39:01 AM","formId":"ETAT","locationId":"","created":1354693141902}
通过使用
select common_schema.get_option(be.config,'encounterid') AS eid
, common_schema.get_option(be.config,'providerid') AS gender
, common_schema.get_option(be.config,'patientid') AS pid
from bencounter be
得到我需要的东西.
但是,我无法获得’obs’的数据,这些数据是几个“行”的字段和值.
更多对obs的’set’之后的字段的引用返回null
select common_schema.get_option(be.config,'encounterid') AS eid
, common_schema.get_option(be.config,'providerid') AS gender
, common_schema.get_option(be.config,'patientid') AS pid
, common_schema.get_option(be.config,'formId') AS formid -- THIS RETURNS NULL
from bencounter be
有人可以帮我解决这个问题.
我想在MySQL中直接解决这个问题…
克莱门斯