How to get the node root for a child to help connect by front

Hello

I searched in many places to do that, but not able to get the exact o/p sp poster my question here.

I have a table with columns parent_id, child_id and. This parent_child levels can be a lot, but my goal is to find the ultimate parent (do not know the right term)
as if I have a = xyz child_node and its parent company = pqr and her parents = lmn, that might be the ultimate parent is not any other parent.

So if I start with child_code = "xyz" then I should get the parent as "lmn" and not the immediate parent "pqr".

Help, please.

Thank you
Aashish

1. When you want to find all parents position = 100:

SELECT position_id,parent_position_id
FROM position
where position_id = 100
CONNECT BY prior position_id = parent_position_id

2. When you want to find all childs position = 100:

SELECT position_id,parent_position_id
FROM position
where position_id = 100
CONNECT BY prior parent_position_id = position_id

Kind regards
Sayan M.

Tags: Database

Similar Questions

  • How to get the node root for all nodes using oracle SQL?

    Suppose I have an employee table, which has the following features:

    ID name MgrID
    ----------------------------------------
    1 Tom
    Jason 2 1
    3 Kelly 2
    4 Chris 2
    Russ 5 3
    --------------------------------------

    I want to get the following result.

    ID name RootMgrID
    ------------------------------------------------
    1 Tom
    Jason 2 1
    3 Kelly 1
    4 Chris 1
    Russ 5 1
    -----------------------------------------------

    How can I get it?

    Thank you very much

    Like this?

    SQL> with t as
      2  (select 1 id, 'Tom ' name, null mgr_id from dual
      3  union all
      4  select 2 id, 'Jason' name, 1 mgr_id from dual
      5  union all
      6  select 3 , 'Kelly ', 2 from dual
      7  union all
      8  select 4 , 'Chris ', 2 from dual
      9  union all
     10  select 5 , 'Russ ', 3 from dual
     11  )
     12  select id, name, connect_by_root(id)
     13  from t
     14  where name = 'Russ '
     15  connect by mgr_id = prior id
     16  start with id = 1
     17  /
    
            ID NAME   CONNECT_BY_ROOT(ID)
    ---------- ------ -------------------
             5 Russ                     1
    
    SQL>
    
  • How to get the code produced for my Windows XP disc if I have the drive?

    Acquisition of Product Code Windows XP

    How to get the code produced for my Windows XP disc if I have the drive?  I signed the BONE when I bought it all first, but have no way of knowing if this is the way to receive a copy of the product key.

    Here are some utilities, which will display your product keys:

    Belarc Advisor: http://www.belarc.com/free_download.html
    (He did a good job of providing a wealth of information.
    However may not detect a key to office, then try one of the other two below)

    Also: http://www.nirsoft.net/utils/product_cd_key_viewer.html
    and: http://www.magicaljellybean.com/keyfinder.shtml

    Paid (free demo is available): Recover Keys: http://recover-keys.com/
    "quickly scans your system for more than 3000 + software '.
    and produces a list of software activation keys.

    13 keyfinder programs:
    http://pcsupport.about.com/od/productkeysactivation/TP/topkeyfinder.htm

    J W Stuart: http://www.pagestart.com

  • How to get the device model, for example app works on PlayBoook or BlackBerry 10?

    How to get the device model, for example app works on PlayBoook or BlackBerry 10?

    You can use this class: http://goo.gl/GtMLP for information on devices

    something like this:

    String myDeviceModel = android.os.Build.MODEL;
    String myDeviceBrand = android.os.Build.BRAND;
    String myDeviceDevice = android.os.Build.DEVICE;
    
  • Satellite L500-154 - how to get the software packaged for Win7

    How can I get the software "Bundled" for Win 7, I will install Win 7 full (no updates), in the moment is runing Vista on the laptop

    As far as I know, you can't have Win7 recovery media. Laptops ship with Vista can update only.

  • How to get the new update for the help and support

    OT:how to get the new update of the abd support help

    How to get help and support update

    Hello rickstemberger,

    Please click the number of the KB article for more information on how to add Windows Vista Help files.
    KB Article ID: 917607 -I can not open Help files that require the Windows Help program (WinHlp32.exe)

    Microsoft stopped including the 32-bit help files viewer in versions of Windows starting with Windows Vista and Windows Server 2008.
    However, with article 917607, you can download the appropriate version of the Windows Help program (WinHlp32.exe) and add them
    the operating system.

    Sincerely,

    Marilyn
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • How to get the latest fix for CPU

    Hi gurus,

    Hello.


    How to get the latest information from CPU fix for our system EBS 11i, how to get alerts whenever they have released patches of CPU.

    Hi DBA.

    Please check this, hope this helps.

    See the metaink notes:

    Releases of Oracle E-Business Suite 11i and 12 Critical Patch Update knowledge Document (October 2010) [ID 987438.1]

    Information OCT - 2010 CPU patches:

    http://www.Oracle.com/technetwork/topics/security/cpuoct2010-175626.html

    on the paths of the CPU:

    http://www.Oracle.com/technetwork/topics/security/alerts-086861.html

    For the email subscription:

    http://www.Oracle.com/technetwork/topics/security/securityemail-090378.html

    Published by: Amigo on December 22, 2010 07:26

    Published by: Amigo on December 22, 2010 07:29

  • How to get the free license for VMware vSphere Hypervisor 5?

    Please show me the link where I can get the free license for VMware vSphere key 5?

    Connect the link with the register username and password below.

    https://www.VMware.com/tryvmware/index.php?p=free-esxi5&LP=default

    Click on licenses and download tab... you will see the license key.

  • How to get the right drivers for ati mobility radeon graphics card 9200 after updating to windows 7

    I bought a laptop computer, an HP Compaq nx7010.  This has been upgraded to windows 7, but the graphics are bad.  There is a sticker on the unit: Graphics by ATI Mobility Radeon 9200

    How can I get the correct driver to get corrected the desktop resolution? Everything is tense or too big.

    Driver update tools keep telling me this is an adapter to graphics standard VGA etc and if I try to update the adapter it device manager says that they are up to date.

    It's frustrating

    Hello:

    I think that Erico post driver will work, but it cannot simply install by running.

    Download it and run it.  If IT errors out or is not installed, then this:

    Go to Device Manager and click on the VGA Standard controller.

    Then click on the driver tab, click on set to update driver.  Select the 'Browse my computer for software' and navigate to the installation folder that was created when you ran the driver.

    This file will be located in C:\SWSetup\sp30204.  Make sure that the include subfolders is selected and I hope that the driver will be installed.  If this isn't the case, you are unfortunately out of luck.

    The video card in your laptop (Mobility Radeon 9200) is not Direct X 9 capable it is why it does not work.  In other words, it is not windows vista or windows 7 capable.

    If you are able to get the driver to install to be able to change your resolution, which is the best you can do.

    You don't have Aero with this adapter - never.

    Whenever someone plans to upgrade a PC older than one made in 2006, it is essential for them to run the free Windows 7 Upgrade Advisor to avoid disappointment.

    http://Windows.Microsoft.com/en-us/Windows/downloads/Upgrade-Advisor

    Paul

  • How to get the free license for HP Custom Image for ESXi 5.1.0

    Hi there guys.

    I have HP Proliant DL160 G6 and I installed this: https://my.vmware.com/group/vmware/details?downloadGroup=HP-ESXI-5.1.0U3-GA & productId = 285

    I would like to ask how I can get a free license for this hypervisor?

    My server supports only hypervisor 5.1, but none of the most recent versions, then told me to install the one I posted above.

    This version of the free hypervisor and how do I get the license for this last, or where I can download another more recent free hypervisor can 5.1.0?

    Thanks in advance!

    Unfortunately, you can't have the old version free license... As if you were going to a free version, you can try the latest version and key are available with them. Currently esxi 6.0.

    If you bought the license for 5.1, then you can get the license key. another sound impossible.

  • How to get the license key for VC?

    My company just bought 4 x 2 p license Sw from HP and all I received are 4 record/partner activation code separates.

    I have read the document and the code is to download the software and I don't know how I can get the license key to turn in the VC. (I know how to install a VC2.5 license key)

    Any suggestion please.

    Thank you

    The existing process for redeemding a partner activation code is still in place, please review the KB:

    http://KB.VMware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=1003303&sliceId=1&docTypeID=DT_KB_1_1&dialogID=22908232&StateID=0%200%2022592660

    ESG-VMware

    VMware communities user moderator

  • How to get the global variable for an instanceId

    Hello

    I have data in global variables of an instance level. And using that instanceId, how can I get the global-level variables data.

    Please me tips


    Thank you
    Sailendra

    Hello
    I guess you want to get the value of the external variable within the process. You can do like this:

    assuming that it is of type string. For other types of type cast properly...
    String extVarValue = (String) (New Component(instance: this)).get(attribute: extVarName);

    Replace "extVarName" with your project name. It returns the value of your project for the instance that you are currently working.

    -Thank you,
    Malar.

  • How to get the old BIOS for Satellite P100-454?

    Hi all.

    I want to downgrade my BIOS of 4.7 to the original.
    But I have no file bios.bak more and I can't find any old BIOS on the Toshiba site.
    How and where can I get the old BIOS?

    I have a P100-454 runing Vista.

    /Rasmus

    When the new BIOS update came out an old is no longer available.
    What you can try is to contact nearest Toshiba authorized maintainer.
    They have access to the database of Toshiba and they can help you with it.

    Call and ask.

  • How to get the time controller for cRIO-9074 real download

    Hello

    I am a beginner of LabView. Now, I'm doing a project at school with cRIO 9074.

    My problem is that I deleted the default embedded controller system. But in the measurement and automation software I have not found the system controller with function of monitor online. How can I download the load file?

    Wait for your help and thank you for your help.

    Even if you format the cRIO system it should be found by the MAX and opening the software config that you can only reinstall the file system assuming that they are installed on the system (PC).

    Therefore, use the MAX for the cRIO. Maybe it's a help to set the dipswitches to NoApp and IPReset first.

    It may be useful

    Christian

  • How to get the physical channel for USB card as ENET

    Hello

    For my application (VB .NET, using NIDAQmx 8.8), I need to access the 2 cards:

    a USB-6008 and an ENET9163.

    I would like to read the physical channels automatically with this feature NI-DAQmx

    Physicalchannel1ComboBox.items.AddRange (DaqSystem.Local.GetPhysicalChannels (PhysicalChannelTypes.AI, PhysicalChannelAccess.External))

    Unfortunately, he didn't get a single card at once.

    When the USB card is connected, he read the physical channels of the USB card

    When the USB adapter is not plugged in, it read the physical channels of the ENET card.

    I hope someone can help me with this problem!

    Thank you

    RB

    Hello RB.

    To read from multiple channels, you can enter in the drop-down list box "Physical channel", the comma separated channels, custom channels or if you read physics, the string "DevX/Benjamin: Z", where X is the number of device, and X and are the first and the last channel you want to analyze (for example to read to ai0 to ai4 from your device 1 enter "Dev1 / ai0:4"). Among the names of your channels, I guess they are global channels created in MAX? You can always read channels multiple and different advice by separating the comma.

    I hope this helps!

    Kind regards

Maybe you are looking for

  • Problem bei Laden von Excel-Tabelle

    Hallo Zusammen, ICH versuche über eine Exceltabelle in DIAdem responsible zu Navigator just. ES aber nicht gelingt. Also kann ich weder eine noch create Plugin config file. Kann mir someone an dieser Stelle helfen? Die habe ich aufgezeichnet steps (F

  • I have a Dell Inspiron 1501 w / Vista I need to restore factory settings

    I tried CTRL + F11 and F8... they do not work! Can anyone help?

  • where did bookmark.htm located after the system backup and restore?

    My drive hard was not so much the system windows vista backup and restore function told me to back up what I did on an external hard drive.  Reference Dell comes to replace the hard drive, so now I want to recover my old internet favorite Solution Ex

  • Bounce back between first and hearing CC2015 problem

    HelloMy situation is when I lay my sequence on the chronology of the first CC2015 and ready to 'Edit in Audition (CC2015)' all right.Once I have change everything in hearing CC 2015 and you want to send out the first CC 2015 with the "open first" che

  • CC2015

    Comment passer adobe cc2015 in English, this pay to run certain actions.Thank you for your help.I knew do pay CC2014 but here I lost am: