I use SAP-HANA database. I have a simple 2 column table whose columns are id, name. The rows are these:
1 - tom 1 - harry 1 - jack 2 - larry
If you are using HANA with revision 70, you can try this:-
SELECT ID, STRING_AGG(Name, ',') AS Names FROM TAB GROUP BY ID;
And for more info read this
How to Concatenate Column Value from Multiple Rows into a Single Column?