What is the use of the FROM in the Azure DocumentDB SQL-like query language?

08Dc91wk

I am using Azure DocumentDB. I only have one collection with heterogenous document types. I am using a type parameter to distinguish between different document types. I am making use of their SQL-like query language to get documents as follows:

SELECT * FROM Collection c WHERE c.ID = 123

I am getting my connection information, including the Endpoint URI, AuthKey, Database name and Collection name, from a configuration file. It seems like I can use any value for "Collection c" and it essentially just becomes an alias for the whole collection. So what is the point of the FROM section of my query?

Andrew Liu

I think you already got it :)

FROM allows you to set an alias to refer to the collection in other clauses. This may make more sense to you when you include multiple references (e.g. using a JOIN to form a cross-product with nested array elements).

For example:

SELECT food.description, tag.name
FROM food
JOIN tag IN food.tags
WHERE food.id = "09052"

In the query above, we are using referencing both the collection as well as nested array elements within a projection.

You can try this query out on the query demo website.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Avoiding SQL injection in Azure DocumentDB Stored Procedures

From Dev

What is the Query language for OrientDB?

From Dev

How to use sql server like query?

From Dev

Azure DocumentDb error "Query must evaluate to IEnumerable"

From Dev

Azure DocumentDB - Query returning no results

From Dev

Connect to Azure DocumentDB from Android

From Dev

Dynamically build query for Azure DocumentDB

From Dev

What is a good approach for migrating from LINQ to SQL to DocumentDB?

From Dev

Exporting data from Azure DocumentDB

From Dev

What is the use of the FROM in the Azure DocumentDB SQL-like query language?

From Dev

SQL query combination of like and in?

From Dev

SQL Azure - What type of encryption to use?

From Dev

Azure DocumentDB will move from global to regional meters

From Dev

How to use LIKE and NOT LIKE together in a SQL Server query

From Dev

SQL LIKE query in Tarantool

From Dev

Use SQL functions like substr(X, Y, Z) in SQLAlchemy query

From Dev

How to properly use SQL LIKE statement to query DB from Flask application

From Dev

SQL query not working when trying to use LIKE % expression

From Dev

How to use sql server like query?

From Dev

what is the sql query to search a containing word using like

From Dev

Azure DocumentDB - Query returning no results

From Dev

Dynamically build query for Azure DocumentDB

From Dev

What is a good approach for migrating from LINQ to SQL to DocumentDB?

From Dev

Azure DocumentDB, Is it possible to JOIN a list from a certain document to the query?

From Dev

The Java Persistence Query Language - LIKE

From Dev

Getting duplicate records in select query for the Azure DocumentDB

From Dev

Accessing DocumentDb from Azure Functions with dynamic DocumentId

From Dev

How to use WhereBetween date with %LIKE% in sql query

From Dev

azure Mobile app query like sql Statement

Related Related

  1. 1

    Avoiding SQL injection in Azure DocumentDB Stored Procedures

  2. 2

    What is the Query language for OrientDB?

  3. 3

    How to use sql server like query?

  4. 4

    Azure DocumentDb error "Query must evaluate to IEnumerable"

  5. 5

    Azure DocumentDB - Query returning no results

  6. 6

    Connect to Azure DocumentDB from Android

  7. 7

    Dynamically build query for Azure DocumentDB

  8. 8

    What is a good approach for migrating from LINQ to SQL to DocumentDB?

  9. 9

    Exporting data from Azure DocumentDB

  10. 10

    What is the use of the FROM in the Azure DocumentDB SQL-like query language?

  11. 11

    SQL query combination of like and in?

  12. 12

    SQL Azure - What type of encryption to use?

  13. 13

    Azure DocumentDB will move from global to regional meters

  14. 14

    How to use LIKE and NOT LIKE together in a SQL Server query

  15. 15

    SQL LIKE query in Tarantool

  16. 16

    Use SQL functions like substr(X, Y, Z) in SQLAlchemy query

  17. 17

    How to properly use SQL LIKE statement to query DB from Flask application

  18. 18

    SQL query not working when trying to use LIKE % expression

  19. 19

    How to use sql server like query?

  20. 20

    what is the sql query to search a containing word using like

  21. 21

    Azure DocumentDB - Query returning no results

  22. 22

    Dynamically build query for Azure DocumentDB

  23. 23

    What is a good approach for migrating from LINQ to SQL to DocumentDB?

  24. 24

    Azure DocumentDB, Is it possible to JOIN a list from a certain document to the query?

  25. 25

    The Java Persistence Query Language - LIKE

  26. 26

    Getting duplicate records in select query for the Azure DocumentDB

  27. 27

    Accessing DocumentDb from Azure Functions with dynamic DocumentId

  28. 28

    How to use WhereBetween date with %LIKE% in sql query

  29. 29

    azure Mobile app query like sql Statement

HotTag

Archive