Select first N rows of Cassandra table

38.4k views Asked by At

As stated in this doc to select a range of rows i have to write this:

select first 100 col1..colN from table;

but when I launch this on cql shell I get this error:

<ErrorMessage code=2000 [Syntax error in CQL query] message="line 1:13 no viable alternative at input '100' (select [first] 100...)">

What's wrong?

1

There are 1 answers

2
Thorarins On BEST ANSWER

According to the Docs, key word first is to limit the number of Columnns, not rows

to limit the number of rows , you must just keyword limit.

select col1..colN from table  limit 100;

the default limit is 10000