acroa
acroa

Reputation: 3319

string aggregation in Oracle 10g

How to aggregate string( concatenate) with Oracle 10g SQL?

Upvotes: 2

Views: 10364

Answers (5)

SQB
SQB

Reputation: 4078

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.

Upvotes: 0

JoeG
JoeG

Reputation: 13192

Concatenate: CONCAT or ||

Aggregate: COLLECT

Upvotes: 0

Ajadex
Ajadex

Reputation: 2337

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

Upvotes: 1

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;

Upvotes: 2

Mike Mooney
Mike Mooney

Reputation: 11989

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

field1 || field2

Upvotes: 1

Related Questions