select cast(collect(
cast(
case
when (1 = 1) then
'aaa'
else 'bbb'
end
as varchar2(100)
)
order by mt.my_col) as t_varchar2_tab)
from my_table mt;
完整示例:
with my_table as (select to_char(level,'000') my_col from dual connect by level<=10)
select cast(collect(
cast(
case
when (1 = 1) then
'aaa'
else 'bbb'
end
as varchar2(100)
)
order by mt.my_col) as t_varchar2_tab)
as res
from my_table mt;
RES
-------------------------------------------------------------------------------------
T_VARCHAR2_TAB('aaa', 'aaa', 'aaa', 'aaa', 'aaa', 'aaa', 'aaa', 'aaa', 'aaa', 'aaa')
1条答案
按热度按时间pu82cl6c1#
再加一个就行了
cast
:完整示例:
另外,不要将eversql用于oraclesql。它只支持mysql