October 2018
Beginner to intermediate
348 pages
10h
English
CQL allows you to return a count of the number of rows in the result set. Its syntax is quite similar to that of the COUNT aggregate function in SQL. This query will return the number of rows in the customer table with the last name Washburne:
SELECT COUNT(*) FROM packt_ch3.customer WHERE last_name='Washburne'; count------- 2(1 rows)
The most common usage of this function in SQL was to count the number of rows in a table with an unbound query. Apache Cassandra allows you to attempt this, but it does warn you:
SELECT COUNT(*) FROM packt_ch3.customer; count------- 3(1 rows)Warnings :Aggregation query used without partition key
This warning is Cassandra's way of informing you that the query was not very efficient. As described earlier, ...