Listagg, wm_concat or Group_concat equivalent in teradata

Database

Listagg, wm_concat or Group_concat equivalent in teradata

I want to aggregate as "comma-separated values" within a "group by", like MYSQL group_concat:

SELECT
dept, GROUP_CONCAT(ename) as employees FROM EMP GROUP BY dept;

or ORACLE listagg:

select dept, listagg(ename, ',') within group (order by ename) as employees ..

What the equivalent SQL syntax  in teradata.

1 REPLY

Re: Listagg, wm_concat or Group_concat equivalent in teradata

You have to use with recursive to implement listagg.