?如何使用PL/SQL 合并查询的结果集并用逗号隔开
select replace(max(substr(sys_connect_by_path(meaning,','),2)),',',',') cc
from
(select meaning,lead(meaning)over(order by rownum desc) no from tableName )
connect by prior meaning = no
start with no is null;
该博客介绍了如何在PL/SQL中通过使用sys_connect_by_path函数和lead函数,结合connect by子句,将查询结果集合并成一个以逗号分隔的字符串。示例查询展示了从tableName中获取meaning字段,并按特定顺序进行连接。
?如何使用PL/SQL 合并查询的结果集并用逗号隔开
select replace(max(substr(sys_connect_by_path(meaning,','),2)),',',',') cc
from
(select meaning,lead(meaning)over(order by rownum desc) no from tableName )
connect by prior meaning = no
start with no is null;
308
2602

被折叠的 条评论
为什么被折叠?