on 2017 Apr 04 5:58 AM
In SQL server we could do something like this. Please see the source here.
declare @results varchar(500)
select @results = coalesce(@results + ',', '') + convert(varchar(12),col)
from t
order by col
select @results as results
| RESULTS |
-----------
| 1,3,5,9 |
How do I do it in HANA DB?
Request clarification before answering.
A simple look into the online documentation or searching here in the forum would produce the STRING_AGG function as result. This function does exactly what you require, when you use a comma as separator sign.
Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, for that you need a custom function. Fortunately, you're not the first to ask this question and you can put your google-foo to find examples for this in the archive pages of SCN.
User | Count |
---|---|
84 | |
12 | |
9 | |
8 | |
8 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.