Is the “Where Inside” query, like on the Sql Server, in DocumentDB?

I have the following simple Sql Where In, which I am trying in DocumentDB but cannot make it work in the query explorer:

SELECT * FROM root.DocumentDbTest_AllFieldTypes f
    WHERE f.field1 NOT IN (
                            SELECT g.field1 FROM root.DocumentDbTest_AllFieldTypes g 
                            WHERE g.time = "09:12:34"
                          );

I get the following error: Syntax error, incorrect syntax next to

Can someone please tell me the correct syntax, perhaps to execute this IN request?

+4
source share
1 answer

The document is supported by the operator INin the sentences WHERE; but it does not support subqueries.

In other words ... this is supported:

SELECT food.id,
       food.description,
       food.tags,
       food.foodGroup,
       food.version
FROM food
WHERE food.foodGroup IN ("Poultry Products",
                         "Sausages and Luncheon Meats")

This is not supported:

SELECT *
FROM root.DocumentDbTest_AllFieldTypes f
WHERE f.field1 NOT IN
    ( SELECT g.field1
     FROM root.DocumentDbTest_AllFieldTypes g
     WHERE g.time = "09:12:34" );

DocumentDB, , DocumentDB.

0

Source: https://habr.com/ru/post/1605933/


All Articles