Skip to content

Instantly share code, notes, and snippets.

@greenlion
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greenlion/8831099 to your computer and use it in GitHub Desktop.
Save greenlion/8831099 to your computer and use it in GitHub Desktop.
Shard-Query demo queries
select count(*)
from ontime_fact
join dim_date on ontime_fact.date_id = dim_date.date_id
where `Year` between 1990 and 1994 and `Quarter` = 1;
select FlightDate, count(*)
from ontime_fact
join dim_date on ontime_fact.date_id = dim_date.date_id
join dim_flight on ontime_fact.flight_id = dim_flight.flight_id
where `Year` = 1998 and `Quarter` = 1
and Carrier = 'AA';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment