有条件将JSON嵌套到MySQL

时间:2019-01-16 08:49:28

标签: mysql json

我嵌套了json:

[
{ 
    "name" : "stella",
    "deptMapping" : [

        {
            "dept":"Housing Finance",
            "mappedDept": "Housing"
        },
        {
            "dept":"CF",
            "mappedDept": "RF"
        },
        {
            "dept":"SME",
            "mappedDept": "SME"
        },
        {
            "dept":"SME Lending",
            "mappedDept": "SME"
        }
    ]
},
{ 
    "name" : "jackie",
    "deptMapping" : [

        {
            "dept":"SME",
            "mappedDept": "SME"
        },
        {
            "dept":"SME Lending",
            "mappedDept": "SME"
        },
        {
            "dept":"Structured Finance",
            "mappedDept": "Structured Finance"
        },
        {
            "dept":"SF",
            "mappedDept": "Structured Finance"
        }
    ]
}
]

我的mysql版本是5.5。我需要在mysql表中对dept添加所有name。在另一个表中,我需要将mappedDept替换为dept。单靠mysql无法做到这一点。 请建议如何进行以及我可以使用哪些语言。非常感谢

0 个答案:

没有答案