I need help with a query solution
table: roomclimate
id | time | deviceId | temperature | humidity |
---|---|---|---|---|
1 | 2021-12-22 15:49:31 | 1 | 23.5 | 50 |
2 | 2021-12-22 15:49:31 | 2 | 10.5 | 50 |
3 | 2021-12-22 15:59:31 | 1 | 23.5 | 56 |
4 | 2021-12-22 15:59:31 | 2 | 10.7 | 57 |
and now i want to group the values like this
time | dev_1_temp | dev_1_humi | dev_2_temp | dev_2_humi |
---|---|---|---|---|
2021-12-22 15:49:31 | 23.5 | 50 | 10.5 | 50 |
2021-12-22 15:59:31 | 23.5 | 56 | 10.7 | 57 |