Log in: how to find children and return their full hierarchy

I tried to find messages with an answer for this but no luck.

Let's say some queries return line these lines (for example, the employee/manager relationship):

John

-Richard

-Jason

-Mark

-Renee

-Jay

-Mary

If I need to return everybody whose name starts with an "M", I can just wrap the hierarchical query in another SELECTION and apply a condition. Then what I get is:

-Mark

-Mary

However, what I really need, is the following:

John

-Richard

-Mark

-Renee

-Mary

In other words, I need not only the lines that meet the condition, but also all their parents at the root.

Any ideas on if/how this is possible?

Thank you

Luis

Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production
With partitioning, OLAP, Data Mining and Real Application Testing options

SQL > SELECT LPAD (' ', 2 * (LEVEL - 1)). Ename ename
2 FROM (SELECT DISTINCT empno, ename, Bishop
3 FROM emp
4 START WITH ename LIKE'm %'
5 CONNECT BY PRIOR mgr = empno)
6 START WITH mgr IS NULL
7 CONNECT BY PRIOR empno = mgr;

ENAME
-----------------------------------------------------------------------------
KING
BLAKE
MARTIN
CLARK
MILLER

SQL > SELECT LTRIM (LPAD ('-', 2 * (LEVEL - 1)))
2            '-') || ' ') || Ename ename
3 FROM (SELECT DISTINCT empno, ename, Bishop
4 FROM emp
5 START WITH ename LIKE'm %'
6 CONNECT BY PRIOR mgr = empno)
7 START WITH mgr IS NULL
8 CONNECT BY PRIOR empno = mgr;

ENAME
-----------------------------------------------------------------------------

KING
-BLAKE
-MARTIN
-CLARK
-MILLER

SQL >

Tags: Database

Similar Questions

  • How to find children and parent of a resource in the HQU

    How to find children and parents of a resource in the HQU?
    for example, there is a server, how can I find all its services and its platform?

    by the way, where can I get a full HQU API doc? There is no description in detail in the Documentation of HQU:http://support.hyperic.com/display/hypcomm/HQU+Documentation

    Hello

    You can use the ResourceCategory.getPlatform () method to get the parent platform and you can use Resource.getViewableChildren () to the children. Here is a very basic example which comes out in the server.log:

    import org.hyperic.hq.hqu.rendit.metaclass.ResourceCategory
    import org.hyperic.hq.hqu.rendit.helpers.ResourceHelper
    imports org.hyperic.hq.authz.server.session.AuthzSubjectManagerEJBImpl AuthzMan

    def authzMan = AuthzMan.one
    def Overlord = authzMan.overlordPojo
    def rHelper = new ResourceHelper (overlord)

    def resource = rHelper.find (server: 12226)

    println ("" Resource: "+ resource.name +" is a child of ' + ResourceCategory.getPlatform (resource) .name + "and has children:" ")
    resource.getViewableChildren (overlord) .every child {-->
    println (child.name + "\n")
    }

    As far as documentation goes, what you see on this page is all that is available at this time. I use the code source HQApi as reference when I can't find anything in the docs.

  • How to find users and groups in the Sun box

    Please adivce how to find users and group in sunsolaris

    Thanks in advance

    We can get all the details of the Group of the file/etc/Group.

    Similarly the user details are in/etc/passwd.

  • With the help of Hewlett Packard Win 7 64 bit with Lightroom 5.7. I have read many explanations of how to drag and drop digital images in Lightroom - but I never got.  I need to know WHERE LTRM drop, HOW to find them and how to get them I

    I need to know EXACTLY how to drag and drop digital pictures into LTRM. WHERE to put them. HOW to find them. How to MOVE in the DEVELOPMENT MODULE.

    When you drag / drop photos, you actually perform a step to import, so it would be wise to figure out how to import your photos and all of the affected options. I agree with Jim Hess and al., drag / drop are an easy way to screw up your organization. Importing is a much more organized way to manage things. There are a lot of tutorial vid3os on import.

  • How to find .fmb and the path of .fmx pending

    Hi all
    I use oracle EBS 12.1.1
    I can access form of people in India HRMS manager-> people-> Enter and keep the responsibility.
    I want to make some adjustments on this form of people.
    How can I do that.
    Can I have to first FTP which form the server, then how to find where this form is stored?

    Best to ask this question in the forum of the EBS.

  • How to find name and instnace host names in the CCR

    Hello

    How to find the name of the instance of the RAC and the hostnames in RAC environment.

    Thank you

    You can find the information using sqlplus, connect to one of your RAC instances, try with it, hope this helps.

    SQL > select instance_number, instance_name, status of gv$ instance;

    INSTANCE_NUMBER STATUS INSTANCE_NAME
    --------------- ---------------- ------------
    OPEN 1-A01
    OPEN 6 A02
    OPEN 5 A03
    OPEN 4-A04
    OPEN 3 A05
    OPEN 2 A05

    6 selected lines.

  • How to set security and sharing to full control under windows 7

    How could I go to check where change or set my security and sharing to full control under windows 7.

    Thank you.

    Hello

    I suggest to check the following links and check to see if it helps:

    What to know before applying permissions to a file or a folder: http://windows.microsoft.com/en-us/windows7/what-to-know-before-applying-permissions-to-a-file-or-folder

    Most of file sharing: http://windows.microsoft.com/en-us/windows7/file-sharing-essentials#section_4

    Share files with someone: http://windows.microsoft.com/en-us/windows7/share-files-with-someone

    Hope this information is useful.

  • How can I search and return several items from the table quickly (like Matlab find)?

    Hi, I'm a pretty experienced Labview programmer, and I've always wondered if there is a way to quickly search for pictures on several items that meet the selection criteria, equivalent to the Matlab find command.  While my inability to do in Labview has always annoyed me, I now have an application that requires this capability and I need to find a solution.

    Is the fastest way I've found to do this in labview to perform comparisons on the data vectors, then use the Boolean value that results from vector to analyze the table using a loop and shift registers.  I enclose an extract vi a analysis comparative vi to one of the simple searches that I need to do.  On my laptop, this research takes about 600 ms.  In comparison, the equivalent in Matlab:

    newArray=oldArray(find(oldArray(:,4)./oldArray(:,2)>1.5),;

    runs in about 1.2ms.  So, the way I am doing this in Labview is only 400 times slower

    Needless to say, I need to make these types of research many times, and these additional 599 ms start to add up pretty quickly!

    Thanks for your help,

    Aaron

    Hi Aaron,

    the slow part is probably "build group" of the node in the loop.

    Try this:

    Define an array the same size as the input data (or simply uses a copy of it) and the wire that to the shift register. Keep a counter of lines found in the loop. Use IndexArray and ReplaceArraySubset for the loop to move rows found at the beginning of the table (overwrite the 'bad' lines). After the loop simply ReshapeArray the number of found lines...

    Sorry, don't have LV (2009) on hand for editing your snippet.

  • Passing through the system properties in the user accounts, I have a user called "Account unknown" is not appear in manage my accounts, how to find it and access?

    I was looking through system properties... went into the settings in advance to user profiles...     I have a user called "Account unknown" this account is not displayed in manage my account, how can I do to find out what I can access it or delete it if I need to...

    Check out these links:

    Impossible to remove an unknown account, get the error 'cannot delete the unknown account because this object inherits permissions from its parent.
    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-security/unable-to-remove-account-unknown-getting-error-you/8d01c84d-4bda-4A42-9425-53818eb1af21?page=1

    the former admin account controlling many files how to remove this unknown account I have only one account and can not delete or move files.
    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-security/the-old-Admin-account-controlling-many-folders-how/3160990a-e723-45dc-84E8-3e493ef57c89?page=2

    Vista - unknown account
    http://www.Vistax64.com/Vista-account-administration/69763-unknown-account.html

  • How to find discussions and old ideas?

    Yet the issues and ideas of the former Central client available? If so, how can I find those I got comment or followed?

    Hi Amy,

    Old Discussions/questions/ideas are still available for 'Read' access through support.eloqua.com.  Questions/discussions nominal upper created from the old CC have been assessed for accuracy and migrated to the new support portal as knowledge base articles.  The higher nominal idea was created as of the ideas in the transfer area of the idea of the new support portal.

    If you are looking for something specific on support.eloqua.com that you would like me to migrate in the knowledge base, feel free to send me a private message and get the URL.  I'll see if it's already there, and if not, I'll get it there for you.

    For ideas, you can re-create an idea in Exchange for our new idea if it is not already there.  Or, if you want - I can recreate for you if you shot me once again, the URL to the idea.

    Please feel free to friend me (use the link below) and PM me the questions/comments/concerns or the URL that you may have.

    I hope that helps!

    Mary Ann McKinnon

  • How to find, separate and convert hexagonal channels streaming via the com port?

    Hello

    I have a xbee wireless network set up with 3 sensors. Output 1 (23bytes) at 20 Hz, the other 2 (46bytes) to 1 Hz. The data arrives correctly in the computer and I can see the stream on my read series VI (joint) basis. on my software XCTU (terminal program that comes with the wireless nodes), the console displays the packets received:

    22/08/2016 13:36:04.196, 6126, RECV, 7E00178100002B00205A203030303230207A2030303031350D0A00
    22/08/2016 13:36:04.252, 6127, RECV, 7E00178100002B00205A203030303230207A2030303031350D0A00
    22/08/2016 13:36:04.296, 6128, RECV, 7E00178100002B00205A203030303230207A2030303032300D0A04
    22/08/2016 13:36:04.346, 6129, RECV, 7E00178100002C00205A203030303230207A2030303032320D0A01
    22/08/2016 13:36:04.346, 6130, RECV, 7E00178100002F00205A203030303230207A2030303032320D0AFE
    22/08/2016 13:36:04.436, 6131, RECV, 7E002E81000032004F20303230362E332054202B32352E38205020313031382025203032302E3237206520303030300D0AC4
    22/08/2016 13:36:04.436, 6132, RECV, 7E00178100003200205A203030303230207A2030303032300D0AFD
    22/08/2016 13:36:04.486, 6133, RECV, 7E00178100003600205A203030303230207A2030303031350D0AF5
    22/08/2016 13:36:04.536, 6134, RECV, 7E002E81000032004F20303230362E362054202B32362E38205020313031392025203032302E3237206520303030300D0ABF
    22/08/2016 13:36:04.596, 6135, RECV, 7E00178100003800205A203030303139207A2030303030380D0AE9
    22/08/2016 13:36:04.596, 6136, RECV, 7E00178100003300205A203030303138207A2030303030380D0AEF
    22/08/2016 13:36:04.652, 6137, RECV, 7E00178100003100205A203030303139207A2030303032320D0AF4
    22/08/2016 13:36:04.652, 6138, RECV, 7E00178100002F00205A203030303139207A2030303032340D0AF4
    22/08/2016 13:36:04.738, 6139, RECV, 7E00178100002F00205A203030303139207A2030303032310D0AF7
    22/08/2016 13:36:04.786, 6140, RECV, 7E00178100003000205A203030303139207A2030303032300D0AF7
    22/08/2016 13:36:04.836, 6141, RECV, 7E00178100003200205A203030303139207A2030303032320D0AF3
    22/08/2016 13:36:04.886, 6142, RECV, 7E00178100003200205A203030303139207A2030303031380D0AEE
    22/08/2016 13:36:04.946, 6143, RECV, 7E00178100003200205A203030303139207A2030303031330D0AF3
    22/08/2016 13:36:04.996, 6144, RECV, 7E00178100002E00205A203030303138207A2030303031310D0AFA
    22/08/2016 13:36:05.046, 6145, RECV, 7E00178100002C00205A203030303138207A2030303031360D0AF7
    22/08/2016 13:36:05.096, 6146, RECV, 7E00178100002C00205A203030303139207A2030303032350D0AF6
    22/08/2016 13:36:05.146, 6147, RECV, 7E00178100002E00205A203030303138207A2030303031340D0AF7
    22/08/2016 13:36:05.146, 6148, RECV, 7E00178100002F00205A203030303138207A2030303031330D0AF7
    22/08/2016 13:36:05.236, 6149, RECV, 7E00178100003000205A203030303138207A2030303032300D0AF8
    22/08/2016 13:36:05.286, 6150, RECV, 7E00178100003300205A203030303138207A2030303032320D0AF3
    22/08/2016 13:36:05.346, 6151, RECV, 7E00178100003700205A203030303138207A2030303031360D0AEC
    22/08/2016 13:36:05.396, 6152, RECV, 7E00178100003900205A203030303138207A2030303031320D0AEE
    22/08/2016 13:36:05.446, 6153, RECV, 7E002E81000032004F20303230362E332054202B32352E38205020313031382025203032302E3237206520303030300D0AC4
    22/08/2016 13:36:05.446, 6154, RECV, 7E00178100002A00205A203030303138207A2030303031360D0AF9
    22/08/2016 13:36:05.506, 6155, RECV, 7E00178100002600205A203030303138207A2030303032320D0A00
    22/08/2016 13:36:05.506, 6156, RECV, 7E00178100002300205A203030303138207A2030303031380D0AFE
    22/08/2016 13:36:05.566, 6157, RECV, 7E002E8100002E004F20303230362E362054202B32362E37205020313031392025203032302E3237206520303030300D0AC4

    Since it is an endless stream of hexagonal channels, how can I isolate each of them so that I can convert them then their values digital sensor to plot, display, etc.?


  • PowerShot SX720 HS how to find pictures and how to clear them?

    The manual does not seem to correspond to dials. After I took photos, how do I access them in order from the most recent to the least recent? Also, how can I remove them individually or in multiples? It was super simple with my Panasonic Lumix, but I've reached an impasse with the PowerShot manual. Thanks in advance.

    Thank you so much, John. It is useful to remember the complexity of such a device at the beginning of my transition between my Lumix long; and to be encouraged to make good use of the manual, even after that that it has mastered the basics and empties into an embarrassing situation. BTW, I chose the new Powershot compared to a new Lumix 'comparable' in part because the pop-up flash and partly to the reduction of the cost, not to mention some remarkable professionals reviews online.

  • Uninstall windows games 8 and how to find them and delete them

    I can't find games on my windows 8 and when I run the virus it scans stalls on the course through png for the games files

    You want to "Uninstall" your games, rather than just deleting (which removes only the partially).

    Windows key + X

    Control Panel

    Programs

    Programs and features

    (right click on the game of your choice and select 'Uninstall')

    Sometimes the games are listed by the Publisher (such as tangent, rather solitary games, etc.) If you are not sure, do not uninstall it until you do a Web search and will find his name of the editor).

    NOTE:  Be very careful when you do this... it really uninstall quick.  Don't carelessly zip autour with your mouse, or finger or you can easily remove the other important programs by accident.

  • How to properly snapshot and return to a domain controller

    I have 4 x of domain controllers Windows 2003, which 2 are physical and 2 are virtual. I need to install the component of the IMU (for Unix identity management) on each of them.

    I would like to take a snapshot of one of the virtual domain controllers before you install the IMU component to restore if it causes problems.

    Does anyone know how to do this correctly?

    If I install the component on one of the domain controllers, to decide that it does not work as expected, restore the domain controller from the age of 1 hour and restart snapshot will there AD questions? Are there other measures that should be taken?

    Thank you!

    Hello.

    This approach might violate support with Microsoft.  It is possible, but think of the consequences of not having support on ad, before trying this.  I would personally have ready another DC and a good system state backup.

    "Active Directory does not support other methods to restore the contents of Active Directory. In particular, Active Directory does not support any method that restores a 'snapshot' of the operating system or is in the volume of the operating system disk. This kind of method causes a restore in the sequence of update (USN) number used to track changes in Active Directory. When a USN recovery occurs, the contents of data bases Active Directory on the incorrectly restored domain controller and its replication partners can be definitely incompatible"- MS 888794 kb

    Good luck!

  • How to uninstall PSE7 and return to the organiser of PSE5 before installing PSE8

    I have a 64 bit Vista system and currently PSE5 abd than PSE7 installed.  When I installed PSE7, I converted the organizing PSE5 catalogues, but decided I didn't like some aspects of PSE7 and revenue using PSE5.  Thus, PSE5 catalogs are updated and PSE7 catalogs are not up-to-date.  I now want to install PSE8 but want to be sure that it 'Grab' and converts PSE5 organizing catalogs, not obsolete PSE7 catalogs.  Can someone tell me the best way to try out it?  Should I uninstall PSE7 and then install PSE8 didn't so there PSE5 catalogs available to convert in PSE8?  I don't know yet where Vista puts the catalogs.  Everything seems to be different with a 64 bit system.  Any help would be appreciated.

    You must remove the PSE7 catalog file, i.e. *.pse7db. You can search by using Windows Search, or go in PSE7 and find its location under Help-> System Info. PSE7 uninstall does not remove this file, so it is not a necessary step here.

Maybe you are looking for

  • How get my Satellite T130 - 13L?

    Hello! I'd be happy have no answer and help for my fight quistion how do to recover my windows pre for my Satellite T130 - 13L, cause my system dropped down and I had Windows 7 Home pre edition 64-bit n cause there were a few garguillo didn't work wi

  • OfficeJet k7100: 'lines of control open or shorted' repeated error - 344 cartridges

    I have an officejet k7100. I'm getting a problem repeated with original hp 344 colour cartridges the red light on the left flashes (which indicates a color cartridge problem) and the printer refuses to print. When I do a test by TAPPING, the error is

  • Image compression

    Hi all! I have an image, it is very big: 4724 x 3496. So my Golden/Geom-Pattern matching algorithms are so slow. Is it possible to convert a smaller, without loss of information?

  • Remove pre-installed software

    Computers HP are equipped with software pre-installed that I will probably never use and is promotional only.  The following removable without denying Windows 7? 1 HP Media Smart Touch - smart Netflix 2 film theme Pad for HP Media Smart video 3 DVD M

  • scale of table/chart of waveform

    Hello I have 1 meter construction and I need to scan for electromagnetic fields. The user has an option to choose the range he wants to scan. That is, he may choose to analyze only the range from 20cm to 50 cm. I chose to use the waveform table becau