首页 > 解决方案 > 如何使用没有“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"]')--抛出错误

标签: sqlpresto

解决方案


您需要删除 和 之间的一个$[

json_extract_scalar(eventprops,'$["campaign id"]')

推荐阅读