TABLE Structure
TS | Description | Value
2023-02-28 10:42 CLAF 172
2023-02-28 10:42 CLAF3 119
2023-02-28 10:42 CLAF6 114
2023-02-28 10:42 CLAF8 193
2023-02-28 10:42 CLAF9 163
2023-02-28 10:42 CLAF1 132
2023-02-28 10:43 CLAF 88
2023-02-28 10:43 CLAF3 93
2023-02-28 10:43 CLAF6 79
2023-02-28 10:43 CLAF8 153
2023-02-28 10:43 CLAF9 109
2023-02-28 10:43 CLAF1 125
I tried below query but in my case the description value can be any. how can I compare Description with any unique value present in column?
SELECT TS,
MAX(CASE WHEN Description ='CLAF' THEN Value END) AS "CLAF"
FROM TrendTable
GROUP BY TS
Order By TS
If any unique value present in Description column Group By TS:
Expected Output:
TS | CLAF | CLAF3 | CLAF6 | CLAF8 | CLAF9 | CLAF1
2023-02-28 10:42 172 119 114 193 163 132
2023-02-28 10:43 88 93 79 153 109 125
I hope this will help you to understood, Any help is appreciated