【发布时间】:2023-03-26 10:11:02
【问题描述】:
这对我来说似乎很棘手,但就是这样。我有两个名为xp_guru_properties 和xp_pn_resale 的表。在xp_pn_resale 表中,我得到了block 和type 的列,在xp_guru_properties 表中,我得到了property_name 和json 的列。我想匹配这两列,并从xp_guru_properties 中获取json 列中的具体数据。以下是一些示例数据,以免您感到困惑
xp_guru_properties,这次我查了一个数据参考xp_pn_resale表
表格中的json 字段
{
"id": 8174,
"typeCode": "HDB",
"name": "111 Lengkong Tiga",
"newLaunch": false,
"description": "111 Lengkong Tiga",
"totalUnits": null,
"floors": 0,
"topMonth": null,
"topYear": 1988,
"tenure": "L99",
"coverImageId": 3196890,
"districtCode": "D14",
"postcode": "410111",
"streetname": "Lengkong Tiga",
"streetname2": null,
"streetnumber": "111",
"longitude": 103.9114385,
"latitude": 1.324030239,
}
每当我从xp_resale 到guru_properties 表得到匹配时,我只想从json 中获取或提取postcode。就像我想从两个表中匹配111 Lengkong Tega 那么我应该得到postcode: 410111。但这似乎很难,因为我需要连接来自xp_resale 的block 和street_name 以匹配来自guru_properties 的property_name。有人有什么想法吗?提前致谢。急需帮助。
【问题讨论】: