working with the hierarchy

Hello

I work with the hierarchy (using start with and plug by front) in order to built a 'tree' of jobs in the application.

For each job, the hirarchy start with LEVEL 1 to the level "n".

In the example below, I built the hirarchy for job number 34461, with 4 levels.

Of curse, I have hundreds of jobs, but for simplicity I shows that the values of a job.

I need your advice with the following problem:

In the case wherever one of the lines return "bz" in mach_name column, I need to return ALL of the hirarchy work (in the example below - all 11 lines)

where "bz" value didn't exists column mach_name - no lines related to the specific job should be returned.

Please notify.

< code >

SQL > fixed line 300

SQL > with all_data as (SELECT X.JOB_NAME, x.joid, LEVEL,

x.box_joid,

mach_name

OF AEDBADMIN.ujo_job x, AEDBADMIN.ujo_job_tree j

WHERE X.JOID = J.JOID

START WITH J.PARENT_JOID = 34461

CONNECT PRIOR X.JOID = J.PARENT_JOID)

Select all_data.*

of all_data;

JOID'ART BOX_JOID LEVEL MACH_NAME JOB_NAME

------------------------------------ ---------- ---------- ---------- ----------

Ys_Crm_Inv_Push_Load_Ctrl_tr_BOX 31596 1 34461

Ys_Crm_Inv_Push_Load_Ctrl_tr 31605 2 31596

Ys_Crm_Inv_BOX 31586 3 31605

Ys_Crm_Inv 31587 4 31586 bz

Auto Ys_Crm_Inv_OK 31588 4 31586

E_Push_Trx_BOX 31594 3 31605

E_Push_Trx 31595 4 31594 cr

E_Push_Trx_OK 31597 4 31594 auto

Ys_Crm_Load_Cntrl_tr_BOX 31599 3 31605

Ys_Crm_Load_Cntrl_tr 31600 4 31599 bz

Ys_Crm_Load_Cntrl_tr_OK 31602 4 31599 auto

11 selected lines.

< code >

Thank you

SELECT DISTINCT *.

de)

SELECT mytest.*

, COUNTY (CASE

WHEN mach_name = "bz".

THEN 1

END

) ON (SCORE OF CONNECT_BY_ROOT joid'art) AS good_cnt

sys_connect_by_path(joid,'/')

OF mytest

START WITH lvl = 1

CONNECT BY box_joid = PRIOR joid'art

) t

ORDER BY road;

Tags: Database

Similar Questions

  • A HP Officejet H470wl will work with the MacBook Air

    A HP Officejet H470wl will work with the MacBook Air? The driver is still supported? I'll buy an Air.

    Hello..

    New Mac come with v10.11.x El Capitan pre installed.

    I checked for compatible drivers (software) for pinter them HP > http://support.hp.com/us-en/product/HP-Officejet-H470-Mobile-Printer-series/3434 453/model/3434454/document/c04510394 /

    Fact on the Mac, you would use Software Update to install the drivers according to the HP website.

    Printer and scanner software available for download for your Mac

  • SQLite Manager does not work with the v11. Until make you it easier to go back to older versions or newer versions stop, breaking most of the modules I won't use Firefox

    SQLite Manager does not work with the v11. Until that make it easier to return to older versions or newer versions stop, breaking most of the modules I use FirefoxHow to come back at 10 Firefox?

    Update Firefox 23.0 which published yesterday afternoon.

  • I'm a software tester for an internal application to my company. version 10.0.2 is not cmopatible with a few controls within our software. I need the download v9.0.1 whatever works with the controls. Where can I get?

    I'm a software tester for an internal application to my company. version 10.0.2 is not cmopatible with a few controls within our software. I need the download v9.0.1 whatever works with the controls. Where can I get?

    Well, if you need older versions of firefox you can find them on this site:
    - http://www.oldapps.com/firefox.php

    Best regards, G-Cloud.

  • To work with the text to the assignment by the cursor of the large fragment of page it is necessary to change all the time down, 'against the judgment", but the page automatically does not start to rise upward, as happens in other browsers. I ask you for

    After the transition to Windows 7, there was a problem with Firefox. To work with the text to the award by the cursor of the large fragment of page it is necessary to change all the time down, 'against the judgment", but the page automatically does not ascend to the top as it was earlier, and like that occurs in other browsers. It is necessary to press the other key "down" which is him very troublesome. Resettlement on an earlier version (8.0) earlier irreproachably working, gave nothing. I ask you to help

    You must activate the module bar (Firefox > Options or view > toolbars;) CTRL + /) or find bar to make Firefox scroll the page while selecting the text (Ctrl + F).

  • Portege M200 - pen does not work with the screen

    So I bought a pen for M200 and reinstalled the operating system.
    Now I M200 with Windows XP Tablet PC edition, a utility Screen Rotation and usefulness of the stylus button. Now Pen buttons work fine with my new pen, but the screen itself does not work. I mean, the stylus does not work with the screen.

    I have a mouse, and another menu pointing devices in Device Manager and it includes the following submenus:

    HID compatible mouse (I use the random DELL mouse)
    Mouse PS/2 Cimpatible (?)
    --------

    I think there must be something else...
    Please tell me, forum, what drivers should I download to get the pen to work?

    Stand by. Are you using the original image of recovery Toshiba (operating system) or you have installed your version?

  • my photo does not work with the screen saver

    Photos has never worked on Apple TV 4 until today with the 032116 update, but my pictures does not work with the screen saver.

    I dare you to try to tell me how to make it work. Please have a solution, someone.

    Given that Apple isn't really care or help on these forums, it would be great if someone mentioned the steps.

    Thank you

    Can you elaborate on the question?

    These are user forums and this is why you will not see the participation of Apple here

  • HP laserjet p1102w: wireless printer does not work with the new wireless network

    My office moved recently and we have a new wireless network. My printer always wireless worked perfectly on the previous network, but it does not work with the new network. I get a message "the printer is offline. I don't know how to reconfigure so that it detects the new wireless network. Can anyone help? Thank you

    Hi Shlomi,
    Thanks a lot for the info. I'll give it a try today...

  • Which version of Skype works with the old computer Win

    Hello.

    I have a very old pc with Win XP SP3.

    I've updated Skype to the latest version and I can't use my webcam.

    Unfortunately, I don't remember which version of Skype I had before.

    Can you please tell me what is the latest version of Skype still work with the old pc hardware?

    Thank you in advance.

    Bizio

    I was able to downaload and installed Skype_v6.1.0.129.exe and it works like a charm.

    Thanks again for your help.

  • Is Re: Satellite A500-17 X - it allowed to do work with the charger plugged?

    Is it OK to play games / work with the charger plugged into my laptop all the time or by doing this will cause the battery becoming weaker?

    I remember having a laptop earlier and 3 hours battery lasted only 30 minutes.
    This will happen to my Toshiba A500 computer laptop X 17 too if I had to plug my charger all the time?

    Should I get out the battery if you don't use?

    > Is it OK to play games / work with the charger plugged into my laptop all the time or by doing this will cause the battery becoming weaker?
    Yes you can do it and you should not be afraid that this will affect the battery!
    After that the battery has been recharged, the grief process stops and the battery is not looping
    My cell phone is always on the AC adapter at home and the battery is still OK and it work properly!

  • Satellite A210 - 10 c only works with the 800 Mhz instead of 1.6 Ghz

    Hello

    I have a very big problem. One day, I look in Vista on my resource monitor and see that the max freuquence is only 50%.

    So first of all I think that is no problem because the assets 'energy savings' energy recorded.
    I have a Satellite A210 - 10 c portable.

    So I switch to maximum power and perform a test of prime95. But hell, the max freuquence has not changed. I also installed everest and cpu z, but all programs show the same to me:

    My laptop only works with the 800 Mhz instead of 1.6 Ghz!

    I'm looking for drivers for the AMD processor, but you need not for Vista. Update all the drivers of Toshiba and Programms and BIOS (in fact, it is the 1.9).

    Nothing helps.

    As a last test, I reinstalled Vista, but also did not help.

    And now I'm at a loss what to do.

    I hope someone can help me.

    Good bye...

    Have you installed the Vista using the recovery CD or the original CD of Microsoft Vista?

    I ask because the restore CD contains all drivers for Toshiba and yellow exclamation marks should not be apparently in Device Manager.

    If you used the original CD of Vista I think that you have not installed the Package of Intel Robson.

    I found the package of Robson on the Toshiba driver-> Satellite P200 area page.

    Maybe you should check this.

    Your comments would be appreciated

  • Will 1st gen magic mouse will work with the new Mac Mini?

    #1

    I'm going to buy a new Mac Mini and one of the options is to add a second magical mouse of gen. I have a first gen magic mouse. I guess this first mouse magic gen will work with the new Mac Mini, but I want to check.

    The old mouse Apple and any other generic pc mouse will work fine with the Mac Mini.

  • Satellite C55: microphone does not work with the connected headphones

    Hey everybody,

    I have a Toshiba Satellite C55. I've seen other forums posted on this topic, but none of the solutions seem to work for me. I tried to uninstall the drivers and restart the computer, and configure the microphone when the headphones are connected.

    My microphone (installed on the laptop) works completely fine... until I have plug in my headphones. He stops working, but I can still hear the music or friends through my headphones. They have a regular pair of Sony headphones, not headphones, so they do not have a microphone on them or anything. My microphone has never worked with the headphones plugged in, and the computer is only a few months old. I would really appreciate a clear solution, thank you for taking the time to look!

    What Satellite C55 do you have exactly?

    This laptop does support that one socket for headset and microphone, or you have two different plugs: one for mic and one for headphones?

    Usually, you can check the playback (speakers, headphones) devices and recording devices (microphone and external microphone) in the control panel → sound → playback (or recording) tab

    If you need to check if the internal MIC is set as device by default when the headphones are connected.

    In the event that the laptop uses the Realtek audio driver
    Reach
    Control Panel → Manager Realtek HD Audio → select Mic tab → click Device avancΘs
    Then select option button separate all entries in the independent input devices.
    Click OK
    Speakers of tray right click (Volume) then the recorders (confirm the microphone is active) → select microphone → click on set default (default device)
    Then close

  • Pencil of Apple works with the other iPads, or iPad pro?

    Pencil DDoes Apple works with the other iPads, or iPad pro?

    It works with the Pro

  • Apple sim does work with the iPhone too, or the iPad?

    does anyone have an idea if sim Apple works with iiPhone, neither iPad?

    N ° it does not work with the iPhone.

    Know what SIM card from your iPhone or iPad using - Apple Support

Maybe you are looking for

  • Account reset - 32644 Toshiba e-store

    Hello I have a Toshiba JournE and I need help with Virtualstore (white screen on startup), please do a reset of the account, the account number is 32644Thank you! * P.S. Please explain what "restart" and "reboot" for this currency. I had to restart a

  • Spinner Skype constantly running

    When Skype works up it is connected to the internet and shows the status of the contacts correctly. Using the latest version of 6.0.0.126. Home page of Skype is view spinner charger continually running and do not show the data from the home page. Sky

  • Recycle Bin

    Hi all When I try to empty the trash he comes back with the error. Memory could not be written. That's why he doesn't let me delete files in there. Any suggestions welcome Tony

  • launch the project and vi by program

    Hello I need to start a project by a vi program and then load a vi of this project. When I try the vi is not running in the instance of project. (see attachment - run 'launch proj n vi.vi' this should launch the "launcher.lvproj" project, and then op

  • Updating the measures for Win - XP Pro, SP1 to SP3 (jump SP2?)

    I do volunteer work 1/2 day per week for a small organization non-profit organizations with a very limited budget (almost non-existent). We work in the given space, but have free access to the DSL service. We have the following... 1 2000 computer HP