I'm trying to run the following CQL statement using the latest Datastax Cassandra driver for Java:
SELECT * FROM tablename WHERE column_one=1 AND column_2=9 AND column_3=50;
Here's what I have so far (only 2 ANDs), but I can't find a way to chain more than 2 where Clauses using and():
Statement select = QueryBuilder.select().all().from( "tablename").where(QueryBuilder.eq("column_one", 1)).and(QueryBuilder.eq("column_two", 9));
Thanks!
The following should work:
Statement s = QueryBuilder.select().all()
.from("tableName")
.where(eq("column_1", 1))
.and(eq("column_2", 9))
.and(eq("column_3", 50));
It produces the following statement:
SELECT * FROM tableName WHERE column_1=1 AND column_2=9 AND column_3=50;
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