removing join operations from a grouping query
问题 I have a table that looks like: usr_id query_ts 12345 2019/05/13 02:06 123444 2019/05/15 04:06 123444 2019/05/16 05:06 12345 2019/05/16 02:06 12345 2019/05/15 02:06 it contains a user ID with when they ran a query. Each entry in the table represents that ID running 1 query at the given timestamp. I am trying to produce this: usr_id day_1 day_2 … day_30 12345 31 13 15 123444 23 41 14 I would like to show the number of queries ran each day for the last 30 days for each ID, and if no query was