My table has this shape:
UTC_DT ID value
-----------------------------
2021-09-29 12:30:00 1 10
2021-09-29 12:30:00 2 20
2021-09-29 12:30:00 3 30
2021-09-29 12:45:00 1 11
2021-09-29 12:45:00 2 21
2021-09-29 12:45:00 3 31
I need this shape:
UTC_DT 1 2 3
------------------------------
2021-09-29 12:30:00 10 20 30
2021-09-29 12:45:00 11 21 31
I can't figure out how to do that. I thought maybe using PIVOT
, but I can't figure out the correct syntax. Please help.