Skip to main content
1 vote
1 answer
117 views

I have a table test with two columns, each referencing the other ID1 ID2 2 1 3 2 4 3 5 4 Given an id, I need to traverse the chain to return all the rows traversing the chain. Below is the query I ...
sg2000's user avatar
  • 325
4 votes
1 answer
141 views

I have a database in SQLite with these tables and columns: Products: id, name, number, price, category_id. Orders: id, client_id, datetime, sum. OrderProducts: order_id, product_id, product_count. ...
Garp's user avatar
  • 267
0 votes
0 answers
36 views

I have a table like this: total alert group_id hlevel full_path parent_id root_group_id 5100FFFF-60B6-D5CD-FCCD-A8A3E03F0000 1 BizA\DivA 5100FFFF-60B6-D5CD-BFBA-A8A3E03F0000 5100FFFF-60B6-D5CD-FCCD-...
gpkbz's user avatar
  • 1
0 votes
4 answers
135 views

Consider the following: IF OBJECT_ID('tempdb..#TetstData') IS NOT NULL DROP TABLE #TetstData CREATE TABLE #TetstData ( Id INT NOT NULL, PurchaseDate DATE NOT NULL, DepreciationRate ...
monstertjie_za's user avatar
-3 votes
1 answer
64 views

I'm working with hierarchical tree data in DolphinDB and need to solve two specific programming challenges: Generate full paths (concatenated IDs and names) for all nodes, including infinite-level ...
saki's user avatar
  • 319
0 votes
1 answer
67 views

I am trying to generate a series of dates by RECURSION in BigQuery. Unfortunately, the solution DOESN'T work !! Can someone please explain where I might be going wrong ?? Note: I understand that ...
marie20's user avatar
  • 895
0 votes
2 answers
115 views

I need to calculate few metrics for a period of days. The requirement is - For a given day, calculate the metrics based on the past 7 days. I need to output the metrics for every day for the past 2 ...
marie20's user avatar
  • 895
3 votes
2 answers
152 views

I have a table like this: COMPOSANT COMPOSE QTE PA COST LEVEL PARENT1 CHILD1 24 0 PARENT1 CHILD2 2 0 CHILD1 CHILD11 10 1 CHILD1 CHILD12 4 3 12 1 CHILD11 CHILD111 100 1 100 2 CHILD2 CHILD21 5 10 50 1 ...
yoyogi785's user avatar
1 vote
1 answer
51 views

I'm studying graph traversal using recursive CTEs (learnSQL course). The question asks about visiting every city from a starting city. They use a "path" string built up from appended city ...
David Kerr's user avatar
  • 1,507
0 votes
1 answer
104 views

I have a joining table that performs a two-way binding using a single record. In the example below, the record with id=8 is linked to the record with id=4, and the record with id=4 is linked to the ...
L.dev's user avatar
  • 103
-5 votes
1 answer
68 views

Considering following test data: CREATE TABLE products_su ( country varchar(2), intprd varchar(20), period date, su int ); INSERT INTO products_su (country, intprd, "period&...
Kondjitsu's user avatar
2 votes
4 answers
157 views

I have a postgress table incoming_records which contains 2 column supervisor_id, emp_id create table incoming_records(supervisor_id,emp_id)as values (null,01) --top level resources with blank ...
GD_Java's user avatar
  • 1,471
1 vote
2 answers
115 views

I'm seeking help with including deeper recurrence then last row with recursive query. Source data: CREATE TABLE products_su(country, intprd, "period", su)AS VALUES ('GL', 'Medicine', '2019-...
Kondjitsu's user avatar
1 vote
1 answer
71 views

oracle query to loop through multiple records and provide the results Please help qrite an oracle query to achieve above results. input data ID ABRV NXTFILL DAYSOUT_INT DAYSOVER_INT TIME 123 abc null ...
OracleLearner's user avatar
1 vote
1 answer
97 views

I have a recursive CTE definition (graph) in Postgres that involves cycle detection: fiddle CREATE TABLE relationships ( subject_type, subject_id, subject_relation, resource_type, ...
Jonathan Whitaker's user avatar

15 30 50 per page
1
2 3 4 5
141