Hello, Have you looked at using the CLUSTERING ORDER BY and LIMIT features of CQL3?
These may help you achieve your goals. http://www.datastax.com/documentation/cql/3.1/cql/cql_reference/refClstrOrdr.html http://www.datastax.com/documentation/cql/3.1/cql/cql_reference/select_r.html Jonathan Lacefield Solutions Architect, DataStax (404) 822 3487 <http://www.linkedin.com/in/jlacefield> <http://www.datastax.com/cassandrasummit14> On Fri, May 16, 2014 at 12:23 AM, Matope Ono <matope....@gmail.com> wrote: > Hi, I'm modeling some queries in CQL3. > > I'd like to query first 1 columns for each partitioning keys in CQL3. > > For example: > > create table posts( >> author ascii, >> created_at timeuuid, >> entry text, >> primary key(author,created_at) >> ); >> insert into posts(author,created_at,entry) values >> ('john',minTimeuuid('2013-02-02 10:00+0000'),'This is an old entry by >> john'); >> insert into posts(author,created_at,entry) values >> ('john',minTimeuuid('2013-03-03 10:00+0000'),'This is a new entry by john'); >> insert into posts(author,created_at,entry) values >> ('mike',minTimeuuid('2013-02-02 10:00+0000'),'This is an old entry by >> mike'); >> insert into posts(author,created_at,entry) values >> ('mike',minTimeuuid('2013-03-03 10:00+0000'),'This is a new entry by mike'); > > > And I want results like below. > > mike,1c4d9000-83e9-11e2-8080-808080808080,This is a new entry by mike >> john,1c4d9000-83e9-11e2-8080-808080808080,This is a new entry by john > > > I think that this is what "SELECT FIRST " statements did in CQL2. > > The only way I came across in CQL3 is "retrieve whole records and drop > manually", > but it's obviously not efficient. > > Could you please tell me more straightforward way in CQL3? >