incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Rhoden <jacob.rho...@me.com>
Subject Is it possible to set a counter to zero using CQL?
Date Thu, 13 Feb 2014 02:31:55 GMT
Hi Guys,
My question is probably best described by example. Is it possible to indicate that on a particular
day, the total number of “events” were zero.

// Three events today
update mytable count=count+1 where day=“20140101”
update mytable count=count+1 where day=“20140101”
update mytable count=count+1 where day=“20140101”
update mytable count=count+1 where day=“20140101”

// Two events today
update mytable count=count+1 where day=“20140102”
update mytable count=count+1 where day=“20140102”

// Zero events today, so do a count+1 and count-1 to get a zero
update mytable count=count+1 where day=“20140103”
update mytable count=count-1 where day=“20140103”

I need to be able to distinguish between knowing if zero events occurred on that day, or no
processing of data occurred on that day.

Thanks,
Jacob
Mime
View raw message