Reputation: 429
I have a table as follows:
create table #t1(a1 varchar(2))
insert into #t1 select 'AA'
insert into #t1 select 'BB'
I want final result as follows: Which aggregation function should I use.
'AA,BB'
Upvotes: 0
Views: 85
Reputation: 270039
From LISTAGG Function - Amazon Redshift:
select listagg(sellerid, ', ') within group (order by sellerid) from sales
where eventid = 4337;
listagg
----------------------------------------------------
380, 380, 1178, 1178, 1178, 2731, 8117, 12905, 32043
Upvotes: 1