I have the following SQL query:
SELECT Date AS timestamps, Seasons1 AS seasons_1, Seasons2 AS seasons_2,
Seasons3 AS seasons_3, Seasons4 AS seasons_4, Seasons5 AS seasons_5,
Seasons6 AS seasons_6, Seasons7 AS seasons_7
FROM SeasonsTable WITH(NOLOCK)
ORDER BY timestamps DESC
Is there any way to return a single column (called say seasons) that contains all the seasons_* as an array?
For example, this currently returns:
timestamps seasons_1 ... seasons_7
2019-04-28 1.0 2.0 3.0 4.0 5.0 6.0 7.0
but I'd like it to return:
timestamps seasons
2019-04-28 [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0]
Error converting data type varchar to float..