SQL查询将不会通过API运行,但会通过查询工具运行 [英] SQL query will not run via API but will run via Query tool

查看:82
本文介绍了SQL查询将不会通过API运行,但会通过查询工具运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个SQL查询,该查询在数据资源管理器中有效,但在通过SDK运行时似乎不起作用.该查询具有多个"CONTAINS".其中的陈述;类似于:

I have a SQL query which works in the Data Explorer but does not appear to work when run through the SDK. The query has multiple "CONTAINS" statements in it; similar to:

选择*来自c
包含在何处(c.FirstName,"John")
和包含(c.LastName,'Doe')

SELECT * FROM c
WHERE CONTAINS (c.FirstName, 'John')
AND CONTAINS (c.LastName, 'Doe')

也许查询只是被错误地创建了?就像两个语句实际上应该是一个CONTAINS语句一样?任何帮助将不胜感激.

Maybe the query is simply created incorrectly? Like both statements should actually be a single CONTAINS statement? Any help would be appreciated.

推荐答案

嗨Al LeMay,

Hi Al LeMay,

能否详细说明您正在使用哪个Cosmos DB SDK(.NET,.NETCore等)? .NET(在下面的示例中)支持此功能,因此,如果您使用的是.NET,则问题可能与语法有关.如果使用的是.NETCore,则可能不支持CONTAINS字符串函数 (还),并且需要对此进行研究,但是请查看以下内容:

Can you detail which Cosmos DB SDK you are using (.NET, .NETCore, etc.)? This is supported in .NET (example below) and so, if you are using .NET the issue could be syntax related. If you are using .NETCore, the CONTAINS string function is probably not supported (yet) and will need to look into this but, please take a look at the following:

内容(来自

支持的LINQ运算符列表

内置功能


这篇关于SQL查询将不会通过API运行,但会通过查询工具运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆