Hi guys. I'm very new to sql and I'm stuck on what I assume should be a quite easy query...If I have a table that looks something like this:time name data_1 data_22012-01-01 00:01 id_1 1111 22222012-01-01 00:01 id_1 1111 22222012-01-01 00:02 id_2 1111 22222012-01-01 00:03 id_1 1111 22222012-01-01 00:03 id_1 1111 22222012-01-01 00:03 id_3 1111 22222012-01-01 00:03 id_2 1111 22222012-01-01 00:03 id_1 1111 22222012-01-01 00:04 id_4 1111 22222012-01-01 00:04 id_1 1111 22222012-01-01 00:04 id_1 1111 22222012-01-01 00:05 id_2 1111 22222012-01-01 00:06 id_2 1111 22222012-01-01 00:06 id_2 1111 22222012-01-01 00:06 id_4 1111 22222012-01-01 00:07 id_3 1111 22222012-01-01 00:07 id_1 1111 22222012-01-01 00:07 id_1 1111 22222012-01-01 00:08 id_3 1111 22222012-01-01 00:08 id_3 1111 2222
How would a query look like, that show this is a result:time name counted2012-01-01 00:01 id_1 22012-01-01 00:02 id_2 12012-01-01 00:03 id_1 32012-01-01 00:03 id_3 12012-01-01 00:03 id_2 12012-01-01 00:04 id_4 12012-01-01 00:04 id_1 22012-01-01 00:05 id_2 12012-01-01 00:06 id_2 22012-01-01 00:06 id_4 12012-01-01 00:07 id_3 12012-01-01 00:07 id_1 22012-01-01 00:08 id_3 2
For every minute a certain name appears, it should be counted how many times during that minute. All I have is this so far:select time, namefrom my_table