Oracle 10g 中的字符串聚合
如何使用 Oracle 10g SQL 聚合字符串(连接)?
How to aggregate string( concatenate) with Oracle 10g SQL?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如何使用 Oracle 10g SQL 聚合字符串(连接)?
How to aggregate string( concatenate) with Oracle 10g SQL?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(5)
您可以尝试收集功能:
http://www.oracle-developer.net /display.php?id=306
其他一些技巧如下:
http://www.oracle-base.com/articles/misc/StringAggregationTechniques.php
...如果您实际上指的是串联而不是聚合,那么请听取其他人的建议并使用
||
两个字符串之间的运算符:You could try the collect function:
http://www.oracle-developer.net/display.php?id=306
Some other tricks are here:
http://www.oracle-base.com/articles/misc/StringAggregationTechniques.php
...If you actually mean concatenation instead of aggregation then take everyone else's advice and use the
||
operator between the two strings:奇怪的是,它是“||”操作员:
Oddly enough, it's the "||" operator:
您可以使用
||
运算符。例如:'第一个'|| 'Second'
另外,函数
CONCAT(var1, var2)
允许您连接两个 VARCHAR2 字符。例如:CONCAT('第一', '第二')
You could use the
||
operator. Ex:'First' || 'Second'
Also the function
CONCAT(var1, var2)
allows you to concatenate two VARCHAR2 characters. Ex:CONCAT('First', 'Second')
连接:CONCAT 或 ||
聚合:收集
Concatenate: CONCAT or ||
Aggregate: COLLECT
您可以使用一个未记录的函数
wm_concat
。另一种选择是自己推出。我认为 LISTAGG 在 10g 中不可用。There is an undocumented function
wm_concat
that you can use. Another option would be to roll your own.LISTAGG
isn't available in 10g, I think.