sql - 如何使用没有“INVALID_FUNCTION_ARGUMENT:无效 JSON 路径”错误的 json_extract_scalar 函数查询带有空格的 json 属性?
问题描述
json_extract_scalar(eventprops,'$.campaign id')--抛出错误 json_extract_scalar(eventprops,'$."campaign id"')--抛出错误 json_extract_scalar(eventprops,'$.""campaign id""')--抛出错误 json_extract_scalar(eventprops,'$."campaign id"')--抛出错误 json_extract_scalar(eventprops,'$.["campaign id"]')--抛出错误
解决方案
您需要删除 和 之间的一个$
点[
。
json_extract_scalar(eventprops,'$["campaign id"]')
推荐阅读
- bash - 如果早期部分失败,我可以阻止管道的后续部分运行吗?
- linux - 多级单父单子进程树?
- asp.net-mvc - 安装适用于 Visual Studio 2017 的 Oracle 开发人员工具时出错
- vue.js - 如何在 Vue.js 中绑定动画持续时间?
- javascript - jest.mock 中的 Jest 'TypeError: is not a function'
- c++ - AT 命令响应解析器
- dart - 如何使用 Flutterr 及时更改背景颜色?
- c# - 报告查看器“过滤器”
- python - 在 matplotlib 中的 3dscatter 网格上对齐投影的 2d 图
- javascript - 如何避免在多个 Express.JS 路由中重复使用 Passport.JS 代码