SELECT
Description
The SELECT
command retrieves rows from a table. A row is a sequence of expressions defined after the SELECT
keyword.
Expressions may have optional aliases.
table_name
refers to a single IMap
data structure. A table may have an optional alias.
An optional WHERE
clause defines a condition
, that is any expression that evaluates to a result of type boolean.
Any row that doesn’t satisfy the condition is eliminated from the result.
Sorting
You can use the standard SQL clauses ORDER BY
, LIMIT
, and OFFSET
to sort and limit the result set.
Note that, you must add sorted indexes to the map object’s fields to be sorted by.
See the indexing section
for information on adding and configuring indexes. For example, for the SELECT * FROM persons ORDER BY name ASC query,
there has to be a sorted index on the name field as shown below:
|
+
See the below examples for sorting.
The following statement gets the top five employees ordered by the
first_name
field and skipping the first three ones:
The following statement gets the top five employees with the highest salaries.