Hello everyone!
I have a question in the query below. I need you to return the records of parents who have child records attached to them. Records do not have children, they should not appear. How to proceed?
Example:
SELECT TB1.FIELD_SUP, TB1.NUMBER
FROM TABLE1 TB1
START WITH TB1.FIELD3 = '999999'
CONNECT BY NOCYCLE TB1.FIELD_SUP = PRIOR TB1.NUMBER
AND TB1.FIELD4 IN (SELECT TB2.FIELD1 FROM TABLE2 TB2 WHERE TB2.FIELD2 IN ('123456','789123') )
ORDER SIBLINGS BY TB1.NUMBER, TB1.FIELD4;