questdb.io icon indicating copy to clipboard operation
questdb.io copied to clipboard

Tutorial Topic: Exploring your data with the `IN` operator

Open amyshwang opened this issue 2 years ago • 1 comments

My tutorial idea

we can add some story here to illustrate how in could be used using some more complicated examples. Note that there are some missing features to be captured by #1076.

Examples: Our demo has taxi ride database. This can be used as the example.

We want to see how taxi rides have been evolving in the holiday of July 4th in New York City from 10am to 10pm, in 4 hours intervals, from 2009 until 2018. We set the starting timestamp as '2009-07-04T10:00:00', we add the modifier 12h to get until 10pm, then we add 1y;10 to repeat 10 times every year from the starting timestamp.

SAMPLE BY 4h ALIGN TO CALENDAR;```

Note that if you don't know the 1st and last date in your database and you want to query the whole range, you could set up and arbitrary starting year and a large range, like:

```SELECT max(pickup_datetime), count(*) from trips WHERE pickup_datetime IN '1970-07-04T10:00:00;12h;1y;1000' 
SAMPLE BY 4h ALIGN TO CALENDAR;```


Are there any particular tools, concepts, languages or platforms that readers
will learn about?

💡 More in depth knowledge and understanding of the SQL keyword.

amyshwang avatar Sep 29 '22 16:09 amyshwang

Hey! I would like to work on this issue. I want to know the format of the tutorial i.e. [Blog/Docs/Video]?

srini047 avatar Oct 05 '22 07:10 srini047