DocumentDB SQL Order By Clause - DocumentDB SQL

What is Order By Clause in DocumentDB SQL?

  • The querying documents are supported by Microsoft Azure DocumentDB using SQL over JSON documents.
  • The documents can be sorted in the collection on numbers and strings using an ORDER BY clause in your query.
  • The clause can include an optional ASC/DESC argument to specify the order in which results must be retrieved.

Consider the same documents as in the previous examples.

The below code is the AndersenFamily document.

The below code is the SmithFamily document.

The below code is the WakefieldFamily document.

Consider a simple example.

order by clause

The query is given below which contains the ORDER BY keyword.

On executing the above query the following result is produced:

Consider another simple example.

order by clause

The query which contains the ORDER BY keyword and DESC optional keyword is given below:

On executing the above query the following result is produced:

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

DocumentDB SQL Topics