Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
1 answer
89 views

We recently migrated the data from SAP HANA to Oracle. The database is Oracle 19c. I need to know the corresponding Oracle 19c command for the below query. The below query is utilizing STRING_AGG. ...
Luke's user avatar
  • 67
0 votes
1 answer
153 views

I have a dataset that looks like this: Dummy table The desired view I'd like is: enter image description here I have tried the STRING_AGG function, which works, but for only one column. See below for ...
user28412706's user avatar
1 vote
1 answer
280 views

I am trying to query information from 2 tables. The PrimaryTable I simply want to return all columns from all rows in that table. The SupportTable I want to just get all of the ID's from that table ...
Stanton's user avatar
  • 1,108
1 vote
1 answer
129 views

Consider 'Table 1' below: id x 1 A 1 B 1 C 2 B 2 C 3 A I want to query Table 1 to produce the following: id x grps 1 A B, C 1 B A, C 1 C A, B 2 B C 2 C B 3 A Using string_agg and grouping by id ...
David Ranzolin's user avatar
1 vote
1 answer
3k views

Is there any equivalent of Postgres: STRING_AGG with OVER() or Oracle LISTAGG with OVER() in SQL Server? I would like to concatenate text values without grouping it, so I need STRING_AGG in analytical ...
drk's user avatar
  • 137
0 votes
1 answer
110 views

I have a set of tables aimed at representing a profile storage system. I have created a view that should display all the important parts of this profile, that being things like the name, email, number ...
ThebulletKin's user avatar
0 votes
1 answer
48 views

I want to calculate the cost by multiplying a price with the quantity of my equipment. My data are like that : idnt_eqpm prx_tot_net prix_pump_ht 10954847 10 8 And I want this data : idnt_eqpm ...
DE_Bytel's user avatar
0 votes
1 answer
84 views

Below is my working Oracle query- -- User-Defined TYPE create or replace TYPE varchar2_ntt AS TABLE OF VARCHAR2(4000); -- This works select emp.DEPT_NAME, CAST( COLLECT(emp.EMP_ID ...
satya prakash Panigrahi's user avatar
0 votes
1 answer
96 views

Reference Tutorial- oracle-developer.net Below is my working Oracle query- -- User-Defined TYPE create or replace TYPE varchar2_ntt AS TABLE OF VARCHAR2(4000); -- User-Defined FUNCTION CREATE FUNCTION ...
satya prakash Panigrahi's user avatar
0 votes
1 answer
61 views

For the last couple of days my head is spinning around this issue and I am really hoping you can help me with this. So simplifying the issue. This is the table I already have: ID Message Time Zone 1 A ...
Hugo Sanches's user avatar
2 votes
1 answer
3k views

Snowflake allows to concatenate string across multiple rows by using aggregate/windowed LISTAGG function. Sometimes we just need first few occurrences per group. Similar to GROUP_CONCAT with LIMIT: ...
Lukasz Szozda's user avatar
2 votes
3 answers
199 views

This is my query: SELECT wp.WorkplanID, STUFF((SELECT ', ' + ISNULL(ul.FirstName + ' ', '') + ISNULL(ul.LastName, '') FROM UserLogin ul INNER JOIN Vendors v ON ul....
zargham ghazanfer's user avatar
0 votes
4 answers
113 views

I have 2 columns A & B in a SQL Server table that contain a string aggregated list of codes. The codes in the lists are separated by a semicolon. The string aggregated lists can take any length ...
Yosh07's user avatar
  • 3
-1 votes
1 answer
2k views

I have the following PostgreSQL query: (This is a Kata at codewars, you can find it at the following link: https://www.codewars.com/kata/64956edc8673b3491ce5ad2c/train/sql ) SELECT * FROM ( SELECT ...
Amir saleem's user avatar
  • 1,496
-1 votes
3 answers
240 views

I am looking for a way to concatenate the rows into a comma separated string. Example: I am looking for result as below where Result Seq column should concatenate the result column row by row values ...
Mohan.V's user avatar
  • 141
-1 votes
1 answer
50 views

Data DROP TABLE IF EXISTS cats; CREATE TABLE cats ( litterID int NOT NULL, catID int NOT null, --row uniquifier catFirst varchar(30), catLast varchar(30), catSize int ); INSERT ...
Mike G's user avatar
  • 864
0 votes
0 answers
251 views

I am trying to concatenate values in a column when those values correspond to the same ID number. Here's an example of the data: The query result I want is this: Here is the code I tried to achieve ...
Michael Covell's user avatar
-1 votes
1 answer
92 views

I have a table with more than 10,000 records. When executing the query, I get an error message Msg 245, Level 16, State 1, Line 10 Conversion failed when converting the varchar value 'balance' to ...
Natasha1305's user avatar
0 votes
1 answer
103 views

I need to traspose a column into a row ( by concatenating it) with group by... using : sql server 2019 Example Car_ID Car_Name Owner 1 Ferrari Marco 2 Jeep Enrico 3 Mercedes Matteo 1 Ferrari Andrea 3 ...
Enrico's user avatar
  • 75
0 votes
2 answers
37 views

I have a situation where I would like to put three different columns, each which have multiple rows, into a single row. I am using this code, which works to give me all of the first columns, then the ...
Aaron's user avatar
  • 71
1 vote
1 answer
128 views

I have the following table: ID Number Size 7 1 1.5 7 2 1.5 8 1 1.625 8 2 1.03125 8 3 1.03125 8 4 1.03125 8 5 1.625 8 6 1 8 7 1.625 8 8 1.625 8 9 1.625 9 1 1 9 2 2 9 3 3 9 4 4 9 5 1 I would like to ...
Leah's user avatar
  • 345
0 votes
1 answer
148 views

I have an SQL Server script that concatenates multiple row based on unique ID. I need to be able to combine them into 1 row to avoid showing multiple lines for the same unique ID. The code below is ...
Arsee's user avatar
  • 683
0 votes
1 answer
2k views

I'm trying to concatenate the names of multiple Employees (ordered) based on their hierarchical level, which ranges between 0 and 4, without duplicates. The issue itself is fairly easy to solve (...
GTAMN's user avatar
  • 11
0 votes
0 answers
48 views

I'm using spark version 3.2.1 on databricks (DBR 10.4 LTS), and I'm trying to convert sql server query into a databricks sql query that runs on a spark cluster using spark sql in sql syntax. However, ...
user9532692's user avatar
1 vote
2 answers
188 views

I am planning to run apriori algorithm on a dataset to find association among product purchase. The dataset looks like this order_id <- c('AG-2011-2040','IN-2011-47883', 'HU-2011-1220','IT-2011-...
Timothy Roy's user avatar
1 vote
1 answer
276 views

In my database I have a Tracking Codes table as a child of a single Employment table. Along with other data, I am trying to return all of the Tracking Codes in a comma separated string so there will ...
Penx's user avatar
  • 69
1 vote
2 answers
122 views

While working with postgres db, I came across a situation where I will have to display column names based on their ids stored in a table with comma separated. Here is a sample: table1 name: labelprint ...
Shantilal Suthar's user avatar
0 votes
0 answers
57 views

I'm trying to add a number of values into one, depending on a value coming from multiple different tables. I keep getting a syntax error. So I have the following table: OT_ID CODE OPTION OPTION2 1 6T ...
Lvh's user avatar
  • 25
3 votes
1 answer
121 views

this is my first question in Stack Overflow. I will water down the problem that I have at the moment. I am trying to clean a dataset for a User-based collaborative filtering recommendendation system. ...
Enzo Corsini's user avatar
0 votes
1 answer
369 views

I am trying to get comma-separated values from the following 3 tables: Teams: Id Players: Id, Name TeamsPlayers: Id, TeamId, PlayerId What I am trying to get is a result like this: TeamId PlayerNames ...
Sebastián Rubina's user avatar
0 votes
0 answers
68 views

SQL Fiddle I'd like a query that will merge rows that have if they have the same value in one of 3 columns. If one of of the following columns matches the rows should merge. customerid, externalid, ...
Murphpdx's user avatar
  • 132
1 vote
2 answers
1k views

I have some data which includes sizes, much like the model below. class Product(models.Model): width = models.CharField() height = models.CharField() length = models.CharField() Through ...
S.D.'s user avatar
  • 2,971
0 votes
0 answers
31 views

The objective is to get the the current product grouping after product modification date Tried string aggregation + replacing word for each product...never worked.
cadisafa's user avatar
0 votes
0 answers
39 views

I have this table (test.mytable in the sql script below) CREATE OR REPLACE test.mytable (item STRING(1), I_groupe STRING(1)); INSERT INTO test.mytable (item, I_groupe) values ('A', '1'), ('B', '1'), ('...
rayhug0's user avatar
0 votes
1 answer
259 views

Let's suppose I have this table: 1|A|B|10 2|A|B|20 3|B|C|20 How to write a query to get this value: 1|A|B|10,20 3|B|C|20
developeruser's user avatar
0 votes
0 answers
261 views

The issue is that I have each asset to have its tags, that is, number 6 to have 1,5 in a column, and asset 1 to have 1,3,5 PUTTING literally twice "asset_tag.tag_id" copies the same number ...
A izag alba's user avatar
71 votes
2 answers
135k views

I need to combine texts by group. I found a function called STRING_AGG. select c.id , c.bereichsname , STRING_AGG(j.oberbereich,',') oberBereiches from stellenangebote_archiv as j join bereiche as c ...
Eren G.'s user avatar
  • 965
0 votes
2 answers
1k views

Here's the relational model for the database that I'm going to talk about (a show can have multiple actors and multiple genres): Relational model (sorry, don't have enough reputation to insert an ...
Kevin Németh's user avatar
0 votes
2 answers
1k views

I want to concatenate my data from a particular column which is present in different rows. The Data is something like this: id Name 1 Jack, John 2 John 3 John, Julie 4 Jack 5 Jack, Julie I want the ...
Beginner's user avatar
0 votes
1 answer
387 views

I am very new to SQL Server and it stucks in one task related to the aggregation of data. I tried to put all information on the screen attached. Is there anyone that could support it? My current code ...
atem666's user avatar
0 votes
2 answers
2k views

In the first place, my query (actually subquery, continue on reading) contains a LISTAGG, but I need to replace it with XMLAGG when users are started to get result of string concatenation is too long ...
RaZzLe's user avatar
  • 2,150
0 votes
0 answers
116 views

So, here is my SELECT query... it's working, but i want to get (with left join) only message types, which are NOT exists in CONFIG table: SELECT PARTNER.ID AS [ID], ...
seesharp's user avatar
  • 133
0 votes
1 answer
5k views

I have the following json passed into a prameter in SQL server 2016: [ { "item_name": "Settee" }, { ...
adam78's user avatar
  • 10.2k
0 votes
0 answers
23 views

I have given SQL-query SELECT * FROM (SELECT * FROM Customer INNER JOIN Product ON Customer.Ids = Product.CustomerId) as a And here IS output that I have: Customer_ids name gender age phone ids ...
Руслан Пилипюк's user avatar
1 vote
1 answer
161 views

I have the columns and rows for the table A, tableid featureid col3 col4 coldatetime 1 1 AD 4 2022-06-22 09:00:00 2 2 BC 5 2022-06-22 09:00:00 3 1 AE 6 2022-06-22 10:00:00 4 3 BD 7 2022-06-22 11:00:00 ...
Bannarisamy Shanmugam's user avatar
2 votes
1 answer
976 views

I have a data table test: id key 1 2365 1 2365 1 3709 2 6734 2 1908 2 4523 I want to aggregate unique key values by id into vector using data.table package. Expected output: id key_array 1 "2365&...
Hilary's user avatar
  • 485
1 vote
0 answers
206 views

I have 2 tables linked together via 3rd association table: TABLE NAME: lot id | description | <other multiple columns> | 1 | descr_string_1 | ... | 2 | descr_string_2 | ...
Krank's user avatar
  • 161
0 votes
3 answers
5k views

I have the following query (showing for each customer the list of users): select cu.customer_id , STRING_AGG(u.first_name + ' ' + u.last_name , ',') as users from customer_user cu join user u on cu....
Leah's user avatar
  • 29
0 votes
1 answer
1k views

I have a table with 2 columns organization_id | user_name 1 | abc 1 | xyz 2 | bhi 2 | ipq 2 | sko 3 | ask ... Each organization could have any number of users ranging from 1 to 100, 2000 and so on. I ...
Kush Rohra's user avatar
0 votes
1 answer
2k views

I am trying to get data from the different tables using the LISTAGG function in Oracle SQL developer. Able aggregate ID data, but unable to get corresponding ID's value from another table to another ...
Mehadi Hassan's user avatar

1
2 3 4 5
8