'How do I filter and use GROUP BY in Cassandra?

I have a table in Cassandra -

CREATE TABLE orders.orders (
customer text,
ordered_at date,
orders bigint,
PRIMARY KEY (customer, ordered_at)
) WITH CLUSTERING ORDER BY (ordered_at ASC)

I have to do something like -

SELECT customer, count(1) from orders.orders GROUP BY customer HAVING count(1) > 4;

But, it seems to be not working. Is there a way I can do that?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source