Get the parts with very high level in a tree by using Connect by

I have the following table:

CREATE TABLE (Z_BOM2)has VARCHAR2(4 CHAR), B VARCHAR2(4 CHAR));

Insert into Z_BOM2 (A, B) values ('A', 'B');

Insert into Z_BOM2 (A, B) values ('A', 'C');

Insert into Z_BOM2 (A, B) values ('C' ' d ' ");

Insert into Z_BOM2 (A, B) values ('C', 'F');

Insert into Z_BOM2 (A, B) values (', 'E');

COMMIT;

SELECT * FROM Z_BOM2;

AB
AC
CD
CF
DE

A is basically a Parent and B is a child.

I would like to input not valid 'E' and 'F' in a query and get only the parents of high-level both those who should be 'A' for both of them. Here's the query I use:

Select SYS_CONNECT_BY_PATH (, "/") as a path, a, CONNECT_BY_ISLEAF AS worksheet b, level, CONNECT_BY_ROOT b top_level

of Z_BOM2

connect by prior a = b

Start with b IN ('E', 'F');


Which returns the following:

/ DDE10E
/ D/CCD20E
/ C/D/A.AC31E
/ CCF10F
/ C/AAC21F

Why it not return the appropriate top-level parent?

This isn't my request.

It is:

select cbr the_parent, a the_child_you_started_with
from (select a, b, level, connect_by_isleaf cbil, connect_by_root b cbr
from z_bom2
connect by prior a = b
start with b in ('D'))
where cbil = 1

She returns B and has

Tags: Database

Similar Questions

  • Where are the best sites for high-level and how information to do different things in Oracle?


    Hello

    Where are the best sites for high-level and how information about various things in Oracle?

    Some examples of things:

    * spa

    * spm

    * db replay

    * Resource Manager

    I need a place high-level

    and also a place of step by step.

    For example, I look at these sites:

    www.Oracle-base.com

    www.psoug.org

    Thank you Roger

    Part of the problem is not so much finding sites that have articles on Oracle, that is to find reliable websites with this information.  When I search my site of certification for resources, I find a significant number of people who have 'technical' Articles on Oracle. However, many of these blog posts have simply no useful information.  It is not even that they are wrong so far as article does not include anything that is not declared more clearly and in detail in the documentation.

    That said, a site you have not mentioned above is the Oracle Learning Library.  There very often an excellent material that is very closely linked to the themes of the certification:

    https://apexapps.Oracle.com/pls/Apex/f?p=44785:1:0

  • need to get the part number for fan of cooling of the laptop dv6 of my desire

    s/n [number of Series edited by Moderator]

    p/n C2L44UA #ABL

    less than two years old fan cooling makes rattling noises now, check the dust, cleaned air jet led, the still small makes fan noise rattling sound, need to get the part number and get a very convenient where the fan dies every day.

    Please help. the hp site "to find the part number" does not work, only list other pieces, but no cooling fan.

    DV6 - 7250CA

    nVidia GT630M graphics i-7 mobile quad-processor

    To be used on the computer models equipped with an Intel processor and a graphics subsystem with discrete memory 682061-001

    HP $51

    eBay $37

    eBay uses $28

    Your manual

    If it's 'the Answer' please click on 'Accept as Solution' to help others find it.

  • I can't create a shortcut to the site on my desktop, when I click on the url bar I can drag on the browser to open a new, but as I drag him on my desktop I get the circle with the line through it, one that looks like a no entry sign. Help?

    I can't create a shortcut to the site on my desktop, when I click on the url bar I can drag on the browser to open a new, but as I drag him on my desktop I get the circle with the line through it, one that looks like a no entry sign. Help

    Try to drag the image to id web site (favicon) on the left side of the address bar, instead of the URL.

  • C20/SX20: is there a way to get the cdr with loss/jitter of the stats?

    I'm trying to get a report with loss/jitter, but doesn't cdr can not find a way to do it.

    (a) TMS is able to report COR but only on the participants/duration/encryption/protocol of appeal

    (b) C20 web gui has information but only with a number of clicks on and only for a call each time

    (c) API C20 (cli) I found some commands, but nothing for the loss/jitter
    I tried xstatus Diagnostics appeal channels-> only for calls in progress.
    tried xHistory recent CallLogs | Call-> nothing usable

    Is it possible to get the cdr with jitter/loss for each C20/SX20 counters in a framework?

    Methods to obtain these data is exactly what you have listed and must be carried out during the call.

  • Get the date with the millisecond of the table

    I want to get the date with milliseconds in table format in the variable. How to get there?

    SQL > create table test_date (col1 date);

    Table created
    SQL > insert into test_date values (sysdate);

    1 row inserted

    SQL > commit;

    Validation complete

    SQL > select * from test_date;

    COL1
    -----------
    18/12/2009


    Here I have to get datewith "millisecond" format and put it into the variable varchar2 (50) and pass this
    to Java.


    SQL > select to_char (COL1, ' mm/dd/yyyy hh24:mi:ss. FF') of test_date;

    Select to_char (COL1, ' mm/dd/yyyy hh24:mi:ss. FF') of test_date

    ORA-01821: date format not recognized

    SQL >

    Thank you
    Khaldi

    user601042 wrote:
    I want to get the date with milliseconds in table format in the variable. How to get there?

    SQL > create table test_date (col1 date);

    Your data col1 type should be TIMESTAMP.

    See you soon
    Sarma.

  • My pdf reezes when I click on COMMENT. I'm trying to get the tools to edit a pdf file. If I use the tools on the toolbar, there is no problem, but as soon as I click on the COMMENT, the document hangs and I have to open the Task Manager to plant it. It st

    Sorry, I'm new to the type of problem-solving process, and I don't know how to change my first speech. My true statement is less to:

    My pdf freezes when I click on COMMENT. I'm trying to get the tools to edit a pdf file. If I use the tools on the toolbar, there is no problem, but as soon as I click on the COMMENT, the document hangs and I have to open the Task Manager to plant it. It started in the last seven days (3.31.15).

    I responded to your questions below, BUT while I was looking for properties, I found repair service REPAIR the INSTALLATION of ACROBAT, and (this is) the issue has been resolved!

    Thanks for making me look for information.

    Karen

    I use Acrobat Pro XI, version 11.0.10.32.

    I created the file, that I worked in during the freeze, so I tried a PDF I created with Adobe and it also freezes when I click on COMMENT. I discover that the OBSERVATIONS of the plug-in is loaded. (See image

    I used the REVIEW for years without this problem occurring. He started in the last 2 weeks.

    I could not find real estate under the file menu, but found a security setting in the preferences in the Edit menu. It doesn't have a way to allow/disallow COMMENT.

  • How to get the RGB value of a pixel in a psd document using scripting Photoshop

    Hi, guys!    Does anyone know how to get the RGB value of a pixel in a psd document using scripts in Photoshop?  I myself have missed for a long time and could not resolve. I am very happy to hear your voice as soon as possible!

    Here is an example...

    var originalUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    var doc = activeDocument;
    var Colour1 = GetHexColour(eyeDropperRGB(1,doc.height-1));
    var Colour2 = GetHexColour(eyeDropperRGB(20,doc.height-5));
    var Colour3 = GetHexColour(eyeDropperRGB(40,doc.height-14));
    alert("Colour 1 = " +Colour1 + "\rColour 2 = " +Colour2 + "\rColour 3 = " +Colour3);
    var decColour = eyeDropperRGB(40,doc.height-14);
    alert("Red = " +decColour[0] + "\rGreen = " +decColour[1] + "\rBlue = " +decColour[2]);
    app.preferences.rulerUnits = originalUnits;
    function GetHexColour(reqHex){
    var out='';
    for(No in colours = reqHex){
     out = out.concat(zeroPad(d2h(reqHex[No]),2));
     }
    return out;
    };
    function eyeDropperRGB(x,y) {
     var x2 = x + 1;
     var y2 = y + 1;
     var out = new Array(3);
     activeDocument.selection.select([[x,y], [x2,y], [x2,y2], [x, y2]], SelectionType.REPLACE, 0, false);
     for(ch in list = ["Red", "Green", "Blue"]) {
     histogram = activeDocument.channels[list[ch]].histogram;
      for (i = 0; i <= 255; i++) {
       if (histogram[i]) {
        out[ch] = i;
        break;
       }
      }
     }
      return out;
    };
    function d2h(d) {return d.toString(16);}
    function zeroPad(n, s) {
       n = n.toString();
       while (n.length < s)  n = '0' + n;
       return n;
    };
    
  • How can I get the shutter count for my Canon 7 d Mark II using Windows XP?

    How can I get the shutter count for my Canon 7 d Mark II using Windows XP? I have been looking for many places and make downloads of files, but I can't seem to find anything. I am wary of downloading software that I know nothing. Any help is greatly appreciated.

    Hi, I paid only $2.99 acquired program namely the supreme court on a 7 d Mark 2

    Search: direstudio.com to find out.

  • I get the A12E5 error code when starting Adobe Application Manager, I use a Mac and want to have Illustrator running

    I get the A12E5 error code when starting Adobe Application Manager, I use a Mac and want to have Illustrator running

    Products of Adobe Creative Cloud installation error A12E5

  • Start forms for the sake of security, get the part exactly unsign pot?

    start with a safety concern forms
    How to get the exactly a part of the component that is not signed?

    env:
    4 FF / IE 8 with
    Sun JRE 6_24
    As a Forms 10.1.2.


    get the warning "Java has discovered application components that could indicate a security problem
    name: oracle.forms.engine.main

    Although

    all have the jar files are signed based on sign_webutil.bat
    with JAR_KEY = webutil2

    How to get the exactly a part of the component that is not signed?

    Well, "oracle.forms.engine.Main" is part of the frmall.jar, and since we know that this file is signed correctly (unless you changed it) the dialog box is displayed without doubt because you set a BACKGROUND or SPLASHSCREEN LOGO. These are defined in formsweb.cfg. It is also possible if you use other images customized in your app - either in a menu or other buttons.

    I recommend once again, carefully examining the MyOracleSupport notes. Maybe this isn't a problem with the signature. As I said, it may be the way you access custom images. For example you have imageBase = codeBase? This raises the dialog box if you set one of the above parameters.

  • In this improved version, the tabs went to the task bar very high, so erase my: I have no "file", "edit", "view","tools. "How to make a comeback?

    The area to open new tabs is now all up, thus doing away with the taskbar. "I have no"file","edit","view"," tools, "etc. How to make a comeback? Where did they go?

    With the orange Firefox button displays the menu bar is hidden, you can get the menu bar back quite easily. Right-click on a toolbar, and then click on the entrance to the "Menu bar" to view it.

  • Unable to get the max with Intel pro 3945ABG card Wlan download speed

    Grettings all,.

    I have, as the shows theme, a model of router Philips SNB650 and Intel pro 3945ABG wireless card.
    The card supports up to 54Mbps while the router can handel upp to 108mbps. The router is in the same room as my laptop and I recive full force and 45mbps connection. I also have an internet connection of 100/10 Mbps (100 downwards, up to 10). The problem is that I can never reach maxlimit when I download files.

    One I download since has the same connection as me, and through him, I get 1.45mbps, which is normal with our two connections. However, when I download it and other sources, I never reach more than 1.45mbps a total, counting all together downloads. So when I download 1.45 my brother and someone else, something with connection equalent, the download speed of my brother will decrease, as well as the other connection.

    I contacted Philips suport and asked if he could be a setting in the router which does the job in this way, but the answer I got was that I should turn on max-double-sided. I know where to find it, even if they described in their message. Network connections-> network-> properties-> advanced card and it make the change with the duplex mode. But the only option for windows, built in firewall.

    I searched on the net for possible solutions, but found nothing. However, I found a few tips about the wireless network card. And that's to go to the device run-> ECS-> NIC in question and make a few changes, such as: Power management (max game, have you tried other variants), roaming Aggressivness (set to max, have you tried other variants) and transmitting power (max by default, tried other variations).

    None of the above configurations makes no difference to my network speed. So, now I turn to you, to see if anyone has a solution. Is there a way to change the duplex mode for all wireless network cards?

    Perhaps I should mention that I have the latest drivers for my network card, but he had the same problem with the 'old'.

    Thanks in advance,
    / Martin

    Hello

    I would try to explain what I understand what you're saying.

    Even with a 100/10 connection does not mean what download you to. There are a few Web sites on the internet that test true download you have. You might want to try one, because I never downloaded to my max download rate.

    It entirely depends on many variables. The Web site you download from (they could cap their downloads to customers at 1 Mb if they chose) etc. Could be your ISP that has the problem etc.

    I doubt the computer or settings are the problem. Call your service provider and ask them what the problem is.

  • Get the message (must be high) to open files

    I use Windows XP and sometimes I can't open the Open Office files or download attachments, I get the message (must be).

    This also happens with my files stored in my Docs

    Hello

    (1) don't you make changes to the computer until the problem occurred?

    I suggest you to follow the steps below and check if it helps.

    When you run an .exe on a Windows XP, Windows Vista or Windows 7 computer file, the file can start another program.

    http://support.Microsoft.com/kb/950505/

    Hope this information is useful.

  • I lost the connection between the icons on the desktop and the program. When I click on an icon, I get the OPEN WITH menu.

    I click right-properties and I get C:\Windows\system32\rundll32.exe Application not found.

    I tried to download fixit and got the OPEN WITH menu.

    It sounds like your .lnk and/or your .exe file associations may have been lost.

    You can try to fix the ".exe" and ".lnk" file associations:
    'Windows XP file Association problems'
      <>http://www.dougknox.com/XP/file_assoc.htm >

    or you can try to do a system restore to a point in time before you had this problem:
    "How to restore Windows XP to a previous state"
      <>http://support.Microsoft.com/kb/306084 >
    If you have a .exe association problem, you may need to run the restore of the system from the command prompt:
    "How to start the System Restore tool by using the option of safe mode with the command prompt in Windows XP"
      <>http://support.Microsoft.com/kb/304449 >

    HTH,
    JW

Maybe you are looking for