select ‘Japan’ nation ,’Tokyo’ city from dual
8.)
9.select nation,listagg(city,’,’) within GROUP...dual union all
select ‘Japan’ nation ,’Tokyo’ city from dual
)
select nation,listagg(city,’,’) within...GROUP (order by city)
from temp
group by nation 这是最基础的用法:
LISTAGG(XXX,XXX) WITHIN GROUP( ORDER BY...listagg(city,’,’) within GROUP (order by city) over (partition by nation) rank
13.from temp
with...Tokyo’ city from dual
)
select population,
nation,
city,
listagg(city,’,’) within