Re: DataModelling to query date range

2016-03-24 Thread Chris Martin
.com/apache/cassandra/blob/trunk/doc/SASI.md > > > On Wed, Mar 23, 2016 at 2:08 PM, Chris Martin > wrote: > >> Hi all, >> >> I have a table that represents a train timetable and looks a bit like >> this: >> >> CREATE TABLE routes ( >> start t

Re: DataModelling to query date range

2016-03-24 Thread Chris Martin
art text, > end text, > valid timestamp, > PRIMARY KEY ((start, end), valid) > ); > > Now, you can execute something like: > > SELECT * from routes where start = 'New York' and end = 'Washington' and > valid <= 2016-01-31 and valid >= 2016-

DataModelling to query date range

2016-03-23 Thread Chris Martin
Hi all, I have a table that represents a train timetable and looks a bit like this: CREATE TABLE routes ( start text, end text, validFrom timestamp, validTo timestamp, PRIMARY KEY (start, end, validFrom, validTo) ); In this case validFrom is the date that the route becomes valid and validTo is t