我的输入如下所示:
select a.ab from tableone a ;结果:
aa
bb
cc期望输出:
('aa','bb','cc') 发布于 2021-02-15 06:43:51
使用LISTAGG函数。
表格内容:
SQL> select ab from tableone;
AB
--
aa
bb
cc结果你需要:
SQL> select '(' || listagg(chr(39) || ab || chr(39), ',') within group (order by ab) || ')' result from tableone;
RESULT
--------------------------------------------------------------------------------
('aa','bb','cc')
SQL>https://stackoverflow.com/questions/66203370
复制相似问题