I have a query like
select top 10 Col1,Col2,Col3 from tab1
which gives me
(1, 1, 1)
(5, 2, 59)
(8, 3, 69)
(9, 4, 70)
(10, 5, 71)
(11, 6, 72)
(11, 7, 73)
(11, 8, 74)
(11, 9, 75)
(11, 10, 76)
i want to condense the result as
(1, 1, 1)
(5, 2, 59)
(8, 3, 69)
(9, 4, 70)
(10, 5, 71)
(11, 6, 72,73,74,75,76)
how can i do that in the select query itself?
EDIT
note that all of the columns are of int type. in the query result, i would not mind if the third column was cast to varchar
Edit
Ultimately, i am storing the query results in a dataframe. would it be easier to achieve this using dataframes?