In Microsoft SQL Server (T-SQL), there is a succinct, elegant, and performant set-oriented way to populate a VARCHAR variable with a concatenation of values from multiple rows in a table, i.e.:
DECLARE @vals NVARCHAR(MAX)
SELECT @vals = ISNULL(@vals + ',', '')
+ <some_varchar_column>
FROM <some_table>
Populates @vals
with a comma-delimited string of all values in some_column
from all rows of some_table
(e.g., "value1,value2,value3, ...").
How do I do something similar in Oracle PL/SQL in a similarly elegant way (without needing to write a loop/cursor)?