Database Reference
In-Depth Information
ORDER BY
turned results. Just as in SQL, it takes an option of the column name and either
ASC
or
DESC
for ascending order or descending order, respectively. If the table
was created with a clustering order, the available ordering options are those speci-
fied by that order or reversed; otherwise, it is limited to the order of the clustering
key.
Listing 4.17
Example Usage of
SELECT
with
ORDER BY
SELECT *
FROM events
WHERE url='http://www.google.com'
AND event_time > 1365977131666
ORDER BY event_id DESC;
LIMIT
ber specified. This works exactly like its SQL counterpart.
Listing 4.18
Example Usage of
SELECT
with
LIMIT
SELECT *
FROM events
LIMIT 10;