SQL to CQL: Sorting and Limiting Results
Sorting through SQL is through the ORDER BY, and the sort
direction (ascending or desending) can be specified. However, the
declaration relies on the SQL engine knowing the datatype for the field
and then applying a suitable sorting algorithm for numerical or string
values.
CQL has a sort() that can sort ascending or
descending. To specify the type, use the
type parameter.
| SQL | CQL |
|---|---|
| Sorting in reverse order | |
|
sql |
The limit for the number rows to return is set using the
logscale |
| Sorting on multiple fields | |
|
sql |
logscale |
| Sorting by different data types | |
|
Datatype is automatically determined from the schema sql |
Type must be specified in the parameter logscale |