2,095 questions
0
votes
1
answer
313
views
Multi-level hierarchy data display
I want to fetch a multi-level hierarchy in a sequential manner. I have a table BOMHierarchy in which I have this sample data:
Parent
Child
Parent1
Child1
Parent1
child2
Child1
Child3
Child1
Child4
...
1
vote
1
answer
733
views
Using multiple tables for an Oracle hierarchy query where each table represents a level
I'm researching ways to create a hierarchical SQL query for my Oracle database where Table1 and Table2 have a many-to-one relationship, and Table2 and Table3 have a many-to-one relationship and where ...
1
vote
1
answer
170
views
Loop in the same table on ids found with an id
I have a simple table:
Main_ID
Sub_ID1
Sub_ID2
ID1
ID2
ID3
ID2
ID4
ID5
ID3
ID7
ID12
Where a product in Main_ID is made with products in Sub_ID1 and Sub_ID2.
I would like, for a given id, have all the ...
1
vote
1
answer
213
views
Oracle Hierarchical queries: Translate START WITH ... CONNECT BY PRIOR into 'Recursive Subquery Factoring'
How would the following START WITH / CONNECT BY hierarchical query look like when translated into a RECURSIVE SUBQUERY FACTORING hierarchical query with WITH clause:
SELECT t1.id
FROM table1 ...
1
vote
1
answer
151
views
Filtering out hierarchical data
I need help with a problem I am facing processing hierarchical data.
Schema of the tables that maintain hierarchical data:
Category table:
| ID | Label |
Mapping table:
| ID | QualifierID ...
-1
votes
1
answer
42
views
SQL Query to get the latest product for multiple product migration entries
Below table stores the product migration data. For example PROD1 got migrated to PROD2. I need help in building an optimal sql query which returns me the latest version of the product. For example - ...
0
votes
1
answer
33
views
Why I cannot see data in hierarchy table?
I'm trying to create a hierarchical table in Vue.js, this should be such a base therefore. However, I don't want to show the table with the data. The error would be here:
<tr v-if="item....
0
votes
1
answer
1k
views
Combine values into string inside recursive CTE
I am using a recursive CTE to essentially navigate down a tree structure of id values. At each iteration of the recursion I would like to have a column that represents a string 'list' of all id values ...
0
votes
1
answer
224
views
LISTAGG oracle function incorrect results
I would like to consult on this problem with aggregation function LISTAGG:
select
r.id,
(
select
LISTAGG(
r.id || '##' || cco.id
,
' '
)
from
(
...
0
votes
1
answer
824
views
How to query a tree like structure with multiple tables recursively?
Here is my ER diagram. If I know the user_id, how can I get a single user's user data=>projects=>boards=>posts using a single SQL query?
I have found out about recursive CTE, but all of the ...
2
votes
1
answer
123
views
Nested leaf node
I've stored a tree that contains multiple nodes. Every record in that table represents a node and its parent-node, as follows:
node_id
parent_id
A
null
B
A
C
A
D
B
E
B
As a result, the visual tree ...
-1
votes
1
answer
46
views
PHP, MySQL and multijoin query results. Is there any simple way to "convert" the results into hierarchIcal structure?
Let's say I have such query results. Originally they are absolutely flat rows (like MySQL query results always are) - I just managed to return them so that the current "main record" is ...
0
votes
1
answer
51
views
Cast a dataframe to text following a hierarchical structure
I am working in Jupyter Notebook and I have a dataframe like this
df = pd.DataFrame({'Parent': ['Stay home', "Stay home","Stay home", 'Go outside', "Go outside"], 'Child' ...
0
votes
0
answers
101
views
CirclepackeR text wrapping inside the subsubgroups & customized coloring for all the levels in the Hierarchy Issue
I am working on an Interactive hierarchical graph (packing circles) but I am sort of stuck and I really appreciate your support. I was able to transform the data I have into an acceptable form by the ...
1
vote
1
answer
69
views
Attempting to get a recursive list of pairings in MySQL
I have the 4 following tables in MySQL 8.0:
-- auto-generated definition
CREATE TABLE user
(
id VARCHAR(255) NOT NULL
PRIMARY KEY,
name VARCHAR(255) NULL,
...
0
votes
1
answer
415
views
Hierarchical List in SwiftUI with CoreData
I am trying to implement hierarchical CoreData in a SwiftUI List. I created a new project in Xcode using CoreData and just added a parent(to-one)/children(t-many) relationship to the Item entity:
I ...
2
votes
2
answers
272
views
Efficient Way to Build Large Scale Hierarchical Data Tree Path
I have a large dataset (think: big data) of network elements that form a tree-like network.
A toy dataset looks like this:
| id | type | parent_id |
|-----:|:-------|:------------|
| 1 | D ...
0
votes
1
answer
645
views
Snowflake: Tree Structure (Hierarchical Data and its count)
How do I iterate over all the rows in a table in Snowflake and pass it to a Python function without using pandas?
I have a Snowflake table with following columns:
EmployeeID, EmployeeName, ...
1
vote
1
answer
144
views
Using gratia::data_slice() for a GAM with an offset
I am trying to get my fitted values from a gam with a few of the features on the GitHub version of gratia and am having trouble using the data_slice() function with a model that has an offset. I am ...
0
votes
1
answer
672
views
Hierarchical classification using LCPN (Local Classifier per Parent Node) approach
Objective:
I am working on a Hierarchical Classification problem and want to solve it using the Local Classifier per Parent Node (LCPN) approach using Tensorflow. In order to do so, I have to create ...
2
votes
2
answers
776
views
How to get a recursive tree for a single table element
I have a table of this type
| id | parent_id | | title |
parent_id refers to the id of the same table
I need to get a recursive tree for an element knowing only its parent.
it will be clearer what I ...
0
votes
0
answers
357
views
How to store nested structure in graph database
I am analyzing how to store nested/hierarchical structure in graph database. I want to store like a tree where settings vertex will have two children DigitalInput and Input2 and like in subsequent ...
0
votes
1
answer
283
views
Python: Create DataFrame with hierarchical columns and add columns
I have a DataFrame with a multiindex as follows:
df:
open close
date Symbol
2022-01-01 SPY 100 102
TSLA 232 245
2022-01-02 SPY ...
4
votes
4
answers
128
views
How do I convert a hierarchical dataframe to a list in R?
If I had a hierarchical dataframe like this:
level_1<-c("a","a","a","b","c","c")
level_2<-c("flower","flower",&...
0
votes
2
answers
259
views
In SQL, how do I find first non-matching character between two strings
I am using MariaDB to store hierarchical items whose key is a string of identical length.
It is the key that encodes the relationships (parent, child, ancestor, descendant, none) as follows.
The ...