Questions tagged [string-aggregation]

0 votes
1 replies
Knex, Postgres, and STRING_ARRAY: getting different results
I was testing out a query here using STRING_ARRAY: http://sqlfiddle.com/#!17/952405/1 Also here: SELECT to_char(workshop_date, 'YYYY-MM-DD')...
0 votes
0 replies
Is there a way to take grouped rows and put them in a new column [duplicate]
This question already has an answer here: Comma separated results in SQL 2 answe...
0 votes
1 replies
Nested Loop inside a SQL Statement [duplicate]
This question already has an answer here: Simulating group_concat MySQL function in Microsoft SQL Server 2005?...
0 votes
1 replies
How to get the values seperated by comma in a single column using SQL
I have the below table and expected result. Please let me know if it is possible to achieve the result. Please refer the picture attached....
asked 6 months ago
1 votes
2 replies
How to concatenate rows into one cell and add break line after each one using SQL Server
I am using SQL Server 2017 and I am trying to create a query that concatenates the languages and Levels of Proficiency in one line for every Empl...
0 votes
0 replies
SQL query to append comma with successor value in Oracle [duplicate]
I have a table of two columns Col1 Col2 A 1 A 2 A 3 B 1 B 2 B 3 Output I need is like this Col1...
asked 5 months ago
1 votes
1 replies
Group by PostgresSQL [duplicate]
This question already has an answer here: Postgresql GROUP_CONCAT equivalent? 6...
asked 5 months ago
0 votes
2 replies
How to concatenate items not from main transaction table, but from detail table [duplicate]
This question already has an answer here: Simulating group_concat MySQL function in Microsoft SQL Server 2005?...
0 votes
2 replies
Is it possible to have Multiple String_Agg Columns with Conditions
I have the following table of Event Registrations. In the table, Muti-day events are recorded as an individual record for each registered date....
asked 7 months ago
0 votes
2 replies
SQL Server - STRING_AGG separator as conditional expression
I need to concatenate rows using different separator based on arbitrary logic. For instance: CREATE TABLE t(i INT, c VARCHAR(10)); INSERT INTO t...
0 votes
1 replies
Combine selected columns of multiple rows into one string [duplicate]
This question already has an answer here: Constructing a string out of several records with 2 columns...
0 votes
1 replies
Generate a column based on other column within each case
input: | case_no | activity | country | |---------|----------|---------| | 1 | a1 | A | | 1 | a1 | A | |...
asked 6 months ago
0 votes
4 replies
How to concat cells from same table but different row?
I have the following problem. I have some rows in my table which are nearly the same and i need some cells to concat with cells above. My curren...
asked 7 months ago
0 votes
0 replies
Display query results as a comma delimited string [duplicate]
Would it be possible to construct SQL to concatenate column values from multiple rows? The following is an example: Table A PID A B C Tab...
asked 7 months ago
0 votes
1 replies
sql result column accumulated with commas
I have three tables providers provider_id provider_name email 1 abc abc@gmail.com 2...
-1 votes
1 replies
Group SQL rows with same column value into one row?
Is it possible to group SQL rows with the same column value into one row? -1 Which database? 2018-12-10 04:36:23Z Possible duplicate...
asked 9 months ago
-2 votes
1 replies
how to get all the accounts belonging to a particular Id? [duplicate]
This question already has an answer here: ListAGG in SQLSERVER 4 answers...
asked 4 months ago
-2 votes
1 replies
Incorrect syntax near 'FOR'
Following code is not working - SELECT [LY-1], LY = STUFF((SELECT ',' + name FROM temp1 FOR XML PATH ('')), 1, 1, '' ) FROM temp1...
asked 4 months ago
0 votes
1 replies
how to get one comma separated row from multiple rows in oracle without changing the order
I have a table which contains data as following: Orange Apple PineApple Grapes The final output that I want is: Orange,Apple,PineApple,Grapes...
asked 5 months ago
0 votes
0 replies
How do we know if aggregations on the SSAS cube are unused?
Sql server version: 2016 Is there a way to know if aggregation on the cube is unused ? I have tried to get the information on the DMVs $system.di...
0 votes
2 replies
query that groups cell data based on attribute [duplicate]
This question already has an answer here: Simulating group_concat MySQL function in Microsoft SQL Server 2005?...
asked 8 months ago
4 votes
1 replies
String_agg in sql server 2016
Here is my code in sql server 2016 insert into @entdef_queries(entitydefid,squery) select A.entitydefid ,...
0 votes
1 replies
Collapsing strings from same column into one cell depending on other columns
I have a column in my data (loc) with string values, which I'd like to collapse into one cell/row, per vso/type combination. This is what I curre...
0 votes
1 replies
Get unique values from multiple columns in single request
I have an employee data with several columns. I have a WebAPI that is reading from this database for a search application that surfaces users. I...
0 votes
1 replies
Find Whole Duplicated Invoices in SQL
I'm trying to write some SQL to allow me to get result of possible duplicated Invoices that will have the same [same Items, with Same Quantity],...