开发者

string aggregation in Oracle 10g

How to 开发者_如何转开发aggregate string( concatenate) with Oracle 10g SQL?


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:

select 'abc'||'def' from dual;


Oddly enough, it's the "||" operator:

field1 || field2


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')


Concatenate: CONCAT or ||

Aggregate: COLLECT


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜