I have a simple query:
select * from countries
with the following results:
country_name
------------
Albania
Andorra
Antigua
.....
I would like to return the results in one row, so like this:
Albania, Andorra, Antigua, ...
Solution:
select listagg(country_name,', ') within group(order by country_name) csv from countries;
0 nhận xét:
Đăng nhận xét