我在对 json 结果进行联合操作时遇到问题,因为由于某种原因,我的嵌套 json 查询结果的双引号被转义,这导致我的应用程序出现解析错误。这是示例:
SELECT DISTINCT s.*,
JSON_QUERY((select * from SomeTable WHERE Id = 'some ID' FOR JSON PATH, WITHOUT_ARRAY_WRAPPER)) AS ExampleColumn from [SomeOtherTable] sot where sot.Id = 'some other ID'
UNION ALL
SELECT DISTINCT S1.*, JSON_QUERY((select * from SomeTable WHERE Id = 'some other other ID' FOR JSON PATH, WITHOUT_ARRAY_WRAPPER)) AS ExampleColumn from [SomeOtherTable] sot1 where sot1.Id = 'some other other other ID' FOR JSON PATH
结果是正确的,只有嵌套的 JSON_QUERY 结果转义了双引号。任何人都可以帮助我吗?