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?
To allow Cassandra to select a contiguous set of rows, the WHERE clause must apply an equality condition to the king component of the primary key. The ALLOW FILTERING clause is also required. ALLOW FILTERING provides the capability to query the clustering columns using any condition.
A SELECT expression using COUNT(*) returns the number of rows that matched the query. Alternatively, you can use COUNT(1) to get the same result.
How to use Distinct in Cassandra Query Language. In cassandra you can only select the distinct records from Partition Key column or columns. If Partition key consists of multiple columns, you have to provide all of the columns otherwise you will get an error.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With