I need function, that returns list of strings.
I have data in table like this:
Id MyString ------------------------ 1 First 2 Second 3 Third 4 Fourth
I need function like this (something like this works in oracle):
select LISTAGG(MyString, ', ') as myList where id < 4
That returns something like this:
myList ------------------------ First, Second, Third
Any ideas?
In order to concatenate field values, I would use “GROUP_CONCAT” function in Virtual DataPort Administration tool which is similar to LISTAGG function. For example, GROUP_CONCAT('<row separator>',<field_name>)
An Oracle LISTAGG Function is an aggregate function that returns a single row. This is used to transform data from multiple rows into a single list of values separated by a given delimiter. It operates on all rows and returns single. It returns a comma or other delimiter separatedresult set just like an excel CSV file.
The LISTAGG function is used to aggregate a set of string values within a group into a single string by appending the string-expression values based on the order that's specified in the 'WITHIN GROUP' clause. As a single-set aggregate function, LISTAGG operates on all rows and returns a single output row.
You cannot use LISTAGG function directly in forms. Instead you can create a record group, which uses the LSTAGG and use the record group.
You're looking for GROUP_CONCAT()
Try this:
select group_concat(MyString separator ', ') as myList from table where id < 4
Of course, you can group by
the results.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With