A newer version of this documentation is available.

View Latest

SELECT statement processing

The SELECT statement queries a keyspace. A JSON array is returned that contains zero or more result objects. SELECT behaves as a sequence of steps in a process. Each step in the process produces result objects that are then used as inputs in the next step until all steps in the process are complete. The possible elements and operations in a query include:

  • Specifying the Keyspace: You specify the keyspace that is queried. This is the from-path parameter in a FROM clause. You can also provide a path as keyspace.

  • Filtering the Results: You can filter result objects from the SELECT by specifying a condition in the WHERE clause.

  • Generating a Result Set: You can generate a set of result objects with GROUP BY or HAVING clauses along with a result expression list, result-expression-list.

  • Removing Duplicates: You can remove duplicate result objects from the result set by using the DISTINCT clause.

  • Ordering Items in the Result Set: You can sort items in the order specified by the ORDER BY expression list.

  • Skipping Results: You can skip the first n items as specified by the OFFSET clause

  • Limiting the Number of Results: You can specify the maximum number of items returned with the LIMIT clause.