146 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
44
views
How to migrate Oracle's CONNECT_BY_ISLEAF, CONNECT_BY_ROOT, and CONNECT BY PRIOR to SQL Server? [duplicate]
I have the following query that I am trying to translate:
SELECT
sub.COLUMN_1,
sub.COLUMN_2,
sub.COLUMN_3,
CONNECT_BY_ROOT sub.COLUMN_4,
CONNECT_BY_ROOT sub.COLUMN_5,
...
0
votes
1
answer
118
views
Oracle Apex tree child node returning multiple times
I have an apex tree with 3 layers: (Apex version 22.1)
BU_NAME
ORG_UNIT_NAME
DEPT_NAME
Source Table:
DEPT_BU_LIST
DEPT_ID BU_NAME ORG_UNIT_NAME DEPT_NAME
1 A_BU AX_ORG A1_DEPT
2 ...
2
votes
1
answer
64
views
Oracle hierarchical query joining 2 tables
I have 2 tables: projects and tasks (that's a simplification, but will do for now). PROJECTS has a hierarchy of projects where there can be a detached (standalone) project or a projects hierarchy. ...
1
vote
1
answer
4k
views
What exactly does Oracle NOCYCLE parameter do in hierarchical queries?
Years ago Oracle introduced an optional NOCYCLE parameter to hierarchical queries. However, there is little clarity as to what exactly it does, besides avoiding throwing an error when a cycle is ...
0
votes
2
answers
70
views
Compute the child record value based on the parent value in Oracle PLSQL
I am trying to formulate a query in Oracle DB such that it computes the start_date value for the rows having it as null based on the numoddays , lvl (level), and the previous level's start_date column....
-1
votes
1
answer
52
views
Add column with unique row value
I have a table like this:
SELECT
parent_id,
parent2_id,
parent3_id,
parent4_id
FROM
parents
I need to make it like this:
I need to add column with an unique value of a ...
0
votes
1
answer
112
views
View to return the root node given any children (in Oracle)
We manufacture equipment, and we give every unit we produce a serial number (s/n). We have a parent/child table which we use to establish the relationship between the top-level assemblies and its ...
0
votes
0
answers
71
views
Hierarchical queries, is this example correct?
I'm trying to understand this concept, but this example gives me a headache.
I'd expect that it should behave somehow similarly like resursion/mathematical induction. On every step you have a current ...
0
votes
1
answer
74
views
Re-writting the query without "Connect By "
I am rewriting the query to replace to remove CONNECT BY:
SELECT *
FROM ADM_TRT AT
INNER JOIN UTILISATEUR U
ON U.UTI_ID = AT.UTI_ID
INNER JOIN
(
SELECT CM.MAI_ID
...
0
votes
1
answer
3k
views
How to insert a new row based on previous row
Given table:
Name
Date
Last Date
Frequency
Person1
1-Jan-2022
2-May-2022
30 Days
Expected output:
Name
Updated Date
Some Other Column
Person1
1-Jan-2022
Value 1
Person1
31-Jan-2022
Value 2
Person1
2-...
0
votes
2
answers
397
views
Oracle Oracle hierarchical query to disable foreign keys
I have some code (see below), which uses a hierarchical query that traverses down a table to find all the related Foriegn keys. This seems to be working fine.
Can this be modified not to display the ...
1
vote
3
answers
463
views
Oracle Hierarchical Query at depth level
I have a requirement to build a table from a hierarchical table. Table structure as below:
emp_hier table:
emp_id
supervisorId
100
null
1
100
2
1
3
2
New table:
I have to write a select query on the ...
0
votes
0
answers
61
views
Oracle Start With In Limit
In a complex query, if I enter a small number of records in the startwith, the result returns quickly, but when I manually fill in around 180 records in "in", it seems as if it is locked and ...
0
votes
2
answers
60
views
Hierarchy formatting [closed]
I am trying to create a query that shows the different levels of the hierarchy in different columns
For now it looks like this
Parent
Child
1
2
1
3
2
4
2
5
3
5
I want the output to look like this
Root
...
0
votes
1
answer
69
views
Oracle SQL hierarical query connected by sequential field
I have a scheme of hierarchical tasks such as this:
|-- task_1
|---- task_1_1
|------ task_1_1_1
|------ task_1_1_2
|---- task_1_2
|------ task_1_2_1
|------ task_1_2_2
|-- task_2
etc.
The number of ...