0

查询:我想获取所有在 3 月份出生的人的记录列表。

{
    "details": {
        "state": "CA",
        "city": "San Fransisco",
        "date-of-birth": { // there is a "-" in the key
            "month": "March",
            "year": "2000"
        }
    },
    "personId": "person1",
    "id": "id1"
},
{
    "details": {
        "state": "CA",
        "city": "San Jose",
        "date-of-birth": { // there is a "-" in the key
            "month": "April",
            "year": "2000"
        }
    },
    "personId": "person2"
    "id": "id2"
}

我希望 SQL 查询会是这样的,但出现错误:

select * from c where c.details['date-of-birth'['month']] = "March"

有人可以帮我查询吗?我确实尝试查看文档,但有点困惑。

4

1 回答 1

1

尝试这个

select * from c where c.details['date-of-birth'].month = "March"
于 2020-11-19T21:08:28.810 回答