我想获取今天日期所属的数据,我尝试了以下方法:
select * from tablename where fieldname = dateof(now());
这个查询结果包含日期和系统时间,因此结果不够合适。
我该如何仅获取当前(今天的)日期?
USE test;
create table posts(username varchar,
time timeuuid,
post_text varchar,
primary key(username, time)
);
insert into posts(username, time, post_text)
values ('me', now(), 'Example');
insert into posts(username, time, post_text)
values ('me', now(), 'Example');
select username, dateOf(time), post_text from posts;
http://cassandra.apache.org/doc/cql3/CQL.html#usingdates
http://christopher-batey.blogspot.nl/2013/05/time-series-based-queries-in-cassandra.html
您可以在此处查看文档:http://www.datastax.com/documentation/cql/3.0/cql/cql_reference/select_r.html - ftrujillo