I have a table coming from a query with the following content structure:
+-----+-----------+-------+
|date | sensor_id | power |
+-----+-----------+-------+
|date1| 1 | 0.51 |
|date1| 2 | 0.52 |
|date1| 3 | 0.53 |
|date2| 1 | 0.61 |
|date2| 2 | 0.61 |
|date2| 3 | 0.63 |
|date3| 1 | 0.71 |
|date3| 2 | 0.72 |
|date3| 3 | 0.73 |
+-----+-----------+-------+
Is there a way to transform this table in to the following by using SQL?
+-----+-----------+------------+-----------+
|date | 1 | 2 | 3 |
+-----+-----------+------------+-----------+
|date1| 0.51 | 0.52 | 0.53 |
|date1| 0.61 | 0.62 | 0.63 |
|date1| 0.71 | 0.72 | 0.73 |
+-----+-----------+------------+-----------+