A表中有如下数据:
id | user |
---|---|
1 | {"age": "15", "name": "尚书雨"} |
2 | {"age": "18", "name": "郭雨桐"} |
如果需要查询id为1的记录中user字段中age属性的值,则SQL语句是这样的:
select id, user -> '$.age' as age from A;
id | age |
---|---|
1 | 15 |
A表中有如下数据:
id | user |
---|---|
1 | {"age": "15", "name": "尚书雨"} |
2 | {"age": "18", "name": "郭雨桐"} |
如果需要查询id为1的记录中user字段中age属性的值,则SQL语句是这样的:
select id, user -> '$.age' as age from A;
id | age |
---|---|
1 | 15 |