LIMIT

CQL allows the use of the LIMIT construct, which enforces a maximum number of rows for the query to return. This is done by adding the LIMIT keyword on the end of a query, followed by an integer representing the number of rows to be returned:

SELECT * FROM security_logs_by_location LIMIT 1; location_id | day      | time_in | employee_id | mailstop-------------+----------+---------------------+-------------+----------       MPLS2 | 20180723 | 2018-07-23 11:49:11 |        samb | M266(1 rows)

Get Mastering Apache Cassandra 3.x - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.