on 2013 Dec 12 6:30 PM
Hi all,
I am trying to find an equivalent for LISTAGG to execute on HANA. However, I have not achieved it so far. An example can be found below.
SELECT deptno,
LISTAGG(ename, ',') WITHIN GROUP (ORDER BY ename) AS employees
FROM emp
GROUP BY
deptno;
DEPTNO EMPLOYEES
---------- ------------------------------------------------------------
10 CLARK,KING,MILLER
20 ADAMS,FORD,JONES,SCOTT,SMITH
30 ALLEN,BLAKE,JAMES,MARTIN,TURNER,WARD
3 rows selected.
I have also tried to implement it by using functions. However, as far as I see we can't use nvarchar input/output for user defined scalar functions. And it is also not possible to use procedures in a `select` statement.
What do you advice? An example would be great
Thanks in advance,
Cagdas
Request clarification before answering.
Hi,
as Martin already mentioned, it is called STRING_AGG and has been made available from Revision 71 onwards.
Kind regards,
Roland
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 17 | |
| 8 | |
| 7 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.