1
我有一個SQL(Vertica的)數據庫,看起來像這樣的表格數據...回填土的時間序列數據,SQL
ts src val
---------------------------------
10:25:10 C 72
10:25:09 A 13
10:25:08 A 99
10:25:05 B 22
10:25:02 C 71
我需要「旋轉」入列,並通過回填最後已知值src
列就像這樣。
ts a_val b_val c_val
----------------------------
10:25:10 13 22 72
10:25:09 13 22 71
10:25:08 99 22 71
10:25:05 null 22 71
10:25:02 null null 71
我知道提前src
的所有可能值。
你說得對。我更新了這個例子。 –