Top "String-aggregation" questions

This tag is intended for SQL questions where multiple string (character) values should be aggregated into a single value using GROUP BY.

How can I combine multiple rows into a comma-delimited list in Oracle?

I have a simple query: select * from countries with the following results: country_name ------------ Albania Andorra Antigua ..... I would …

sql oracle concatenation pivot string-aggregation
SQL Query to concatenate column values from multiple rows in Oracle

Would it be possible to construct SQL to concatenate column values from multiple rows? The following is an example: Table …

sql oracle string-aggregation
How to concatenate strings of a string field in a PostgreSQL 'group by' query?

I am looking for a way to concatenate the strings of a field within a group by query. So for …

sql postgresql group-by string-aggregation
How can multiple rows be concatenated into one in Oracle without creating a stored procedure?

How can I achieve the following in oracle without creating a stored procedure? Data Set: question_id element_id 1 7 1 8 2 9 3 10 3 11 3 12 Desired …

sql oracle concatenation string-aggregation
How to make a query with group_concat in sql server

I know that in sql server we cannot use Group_concat function but here is one issue i have in …

sql-server string-aggregation sql-server-group-concat
Simulating group_concat MySQL function in Microsoft SQL Server 2005?

I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that's life). In the …

sql sql-server sql-server-2005 string-aggregation
How do I create a comma-separated list using a SQL query?

I have 3 tables called: Applications (id, name) Resources (id, name) ApplicationsResources (id, app_id, resource_id) I want to show …

sql sql-server tsql string-aggregation
Postgresql GROUP_CONCAT equivalent?

I have a table and I'd like to pull one row per id with field values concatenated. In my table, …

sql postgresql group-concat string-aggregation
How to sort the result from string_agg()

I have a table: CREATE TABLE tblproducts ( productid integer, product character varying(20) ) With the rows: INSERT INTO tblproducts(productid, product) …

sql postgresql string-aggregation
What's the equivalent for LISTAGG (Oracle database) in PostgreSQL?

I have to replace the Oracle driver with the newest PostgreSQL. PostgreSQL doesn't know the function LISTAGG. I have to …

sql postgresql string-aggregation listagg