I have a table which stores data in the following format:
Time | WidgetId | WidgetData
00:00 1 12
00:00 2 5
00:00 3 7
00:01 1 9
00:01 2 13
... ... ...
23:59 3 1
Essentially, for every minute of the day it stores some data about each Widget. The number of widgets is variable, but info about them is stored in another table so is accessible.
I need to produce the results in the following format:
Time Widget1 Widget2 Widget3
00:00 12 5 7
00:01 9 13 ...
... ... ... ...
23:59 ... ... 1
Is this possible just in SQL? I'm using SqLite and can achieve the results with some scripting but it would be ideal if I could get this data out just using a database SELECT.