Kevin Scott • over 5 years ago
Grouping by date with BigSql
We're working with MTA transit data, which is grouped in four hour chunks. I want to write a query that will group the data by day, along with by a particular station. In SQL I would write something like this:
SELECT * FROM data WHERE day > '2014-01-01 00:00:00' AND day < '2014-01-02 00:00:00' AND station='xyz' GROUP BY day, station;
This query is very slow (60 seconds or more). This article specifically mentions difficulties working with dates in Big SQL:
Specifically Listings 7 and 8. However, I cannot figure out how to apply the insights in this article to my query. Can anyone help me out?
Comments are closed.