Skip to content
Advertisement

Time series group by day and kind

I create a table using the command below:

I insert some time series data using the command below:

Some time after having executed several times the insert command, I have some time series data as below:

What I would like to have a command that groups my data by date from the most recent day to the least and the number of each session_kind like below (I don’t want to give any parameter to this command):

How can I group my data as above?

Advertisement

Answer

You can do conditional aggregation:

If you want something dynamic, then it might be simpler to put the results in rows rather than columns:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement