Connet by prior

hi friends i have table like tree
table data;
id  parent id name type
1                   a       type1
2       1          b       type2
3       2          c       type1
4       3          d       type2 i can create tree from this table with connect by prior basicly
my problem is: i write query which give only type1 with again tree format
like this;
id  parent id name type
1                   a       type1
3     1         c       type1**** parent id be 1 in querry resulthow can we do it?
thanks

Hi,
You can try this:
SQL> with t as (
  2  select 1 cid, null pid, 'a' aname, 'type1' atype from dual union all
  3  select 2,     1,        'b',       'type2' from dual union all
  4  select 3,     2,        'c',       'type1' from dual union all
  5  select 4,     3,        'd',       'type2' from dual
  6  )
  7  select cid
  8  ,      substr(path_pid, 1, instr(path_pid, '/')-1) ppid
  9  ,      aname
10  ,      atype
11  from  ( select cid
12          ,      pid
13          ,      ltrim(sys_connect_by_path(pid, '/'), '/') path_pid
14          ,      aname
15          ,      atype
16          ,      level
17          from   t
18          start with cid=1
19          connect by prior cid = pid
20        )
21  where atype = 'type1';
       CID PP A ATYPE
         1    a type1
         3 1  c type1

Similar Messages

  • How can I use one Add-on prior to another for specific MIME-types?

    I'm using Shockwave Flash plugin to watch some videos on YouTube, StreamCloud, etc. It also handles .mkv and .mp4 files/streams. After installing VLC Web plugin to handle MIME-types like mp3/4, mkv additionally and prior to the Flash plugin, Firefox keeps using Flash to handle those types insted. I cannot find options to set the desired priorities. Only disabling the Flash plugin solves my problem, but also keeps me from watching Flash contents, which Is not acceptable.
    Did I miss something or is this Firefox's fault?

    If you type or paste '''about:plugins''' in the address bar and press Enter, you can see which plugins are associated which various content types.
    I do not know how to prioritize one over the other for the same content type if the plugin settings (plugins often have an interface outside of Firefox to adjust their settings) do not allow that.
    As for MP4, I don't think Flash normally would be selected. I suspect the website is specifying a Flash media player and streaming the MP4 through that. If you want to hide the Flash plugin from a particular website, you can use the Permissions tab of the Page Info dialog.
    Click the padlock or globe icon in the address bar, then More Information, then Permissions. The top section of the Permissions panel should be "Activate Plugins". Here you can select Block for Flash for the current site. After reloading the page, does the media play using a different plugin?

  • How do I delete a prior month(s) or entire year(s) in iCal on my iMac (using version 4.0.4 (1395.7)?  Want to delete all months in 2009

    I checked what was previous asked in deleting months from iCal; however, that question pertained to removing events from a month and not necessarily deleting the entire month.  I have three years of calendars (January - December x three) in my iCal and want to delete all months for 2009 and 2010; however, I can't seem to find a way to delete.  I checked preferences/advanced under iCal but no mention of deleting previous months/years.

    Greetings Judith,
    Before making any attempts at deleting calendar data, backup what you have just in case:
    Click on each calendar on the left hand side of iCal one at a time highlighting it's name and then going to File Export > Export and saving the resulting calendar file to a logical location for safekeeping.
    iCal has an automated function located in iCal > Preferences > Advanced > Delete events "X" days after they have passed.  By typing in a value for days you can tell iCal to delete all events before that time frame.
    Example:
    Today is 4-16-2012.
    If I wanted to delete all events prior to 1 year ago (4-16-2011) I would type in "365" for the number of days.
    Once you type in the number of days you want kept in iCal, close the preferences and then quit iCal.
    Re-open iCal and check to see if the events are gone.  If not you may want to leave it open for several minutes and then quit again.
    Once the events are removed go back to  iCal > Preferences > Advanced > Delete events "X" days after they have passed and make sure the check mark is removed to prevent future deletion.
    Hope that helps.

  • SSRS Matrix report. Variance expression by Month. Need to compare month from prior year to current month of current year VS2010

    Please help.  I have a matrix report.  In the report I have row group  PO Type.  One the Column groups I have a parent group by Fiscal Year, and then a child group by Month.  When I run the report, I get two years of data back broken
    out by month.  Please see below.
    Now here is where I am getting stuck.  I need to take the variance between the current month of the current year, from the same month of the prior year.  So I need to show the difference between Oct , 2014 from Oct, 2013. November, 2014 from November
    2013... etc. etc.
    In the example below, how do I create a column or row showing the variance for Contracts for October 2014.  I need to take the contracts for October 2014 which is 3 and subtract that from October 2013 which is 8.  Any suggestions? How do I do that
    for each month?  Then I need to do it for the quarter... then the year?  But I'll be happy if I can just get the month working first.
    Any help will be appreciated. 
    here is what my rdl file looks like.
    Here is what my report looks like when I render it.

    Hi Adrian_s2012,
    According to your description, you want to compare values for the month of current year with the month of prior year and get the variance. Right?
    In Reporting Services, we don't have any function to get this "Year to Year" Growth. In this scenario, if you data source is a cube, we suggest you use Analysis Services to achieve your requirement. If this data source is just from database, it will be hardly
    to calculate the variance because we need to compare the values within every two different column group and matrix generate adjacent columns one by one. Even we make it by using custom, every time executing the long code when generating result
    in a cell will reduce a lot of performance, we really don't suggest to do that in SSRS. Here is a thread with much easier requirement, please take a reference of that:
    http://social.msdn.microsoft.com/Forums/office/en-US/842e2dcb-d949-4297-9d91-eac989692cb5/difference-between-the-grouped-column?forum=sqlreportingservices
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • My iPhone 5 is not being recognized by my Onkyo TX-8050 reciever when plugging into the USB.  Is there a setting on my phone i need to set?  Also, it has worked prior with this receiver however after the new software update will not work.

    I am trying to hook up my iPhone 5 to my Onkyo TX-8050 receiver and it is not recognizing the phone. It recogized my phone prior to software update 7.1.2 and I can use an iPhone 4 and iPad with no issues.  Is there a setting I need to apply for the reciever to recognize?

    Im presently on the Phone with Apple the Lady Im talking to understands its the id and not the password. I finally got somebody that listened to me. Wow and she is plesent to talk to.

  • My iPod 5 will not sync ANY music. All my music was on prior to syncing. The sync deleted all my music. I can now no longer add any music. I have the "sync music" checked. Restoring factory settings did not work. Any thoughts?

    All my music was on prior to syncing. The sync deleted all my music. I can now no longer add any music. I have the "sync music" checked. Restoring factory settings did not work. Any thoughts?

    When you synced with iTunes It would have tried to replace the music on the iPhone with what is on the computer. which is what happens when you sync with iTunes.
    If the songs are purchased you can re-downloaded them Pretty easily. You mentioned that you still see the songs and that you could not play them. Do they have a Cloud symbol next to them? If so this means that you can download them but that they are not on the device.

  • Backup of iTunes library for prior to hard drive formatting

    My PC is currently running on Windows XP and has become very sluggish, so I'm going to format my C: drive and then install Windows 7. I'd like to check what I need to do with iTunes prior to and after formatting my C: drive.
    My music files are on an external hard drive, and as well as a backup of these, I also have a backup of the My Documents\My Music\iTunes folder, which I believe holds all the info regarding play counts, playlists etc. (please coorect me if I'm wrong).
    I'm assuming I then need to do the following:
    - deauthorise my PC for my Apple account and then uninstall iTunes software
    - format my C: drive, then install Windows 7
    - download iTunes software from the Apple website and authorise my PC.
    I just want idiot-proof clarification on the easiest way to get all my tracks and playlist/library info back onto my PC and into iTunes from the the external hard drive, so I have exactly the same library and info that I currently have.
    Many thanks,
    Dan Southam

    More or less... You can leave out the uninstalling iTunes part, the format will take care of that.
    On your rebuilt machine you need to make sure that the same drive letter is assigned to your external drive otherwise the paths that iTunes holds for your files will become invalid. You can restore your backup of the iTunes library folder into C:\Users\<You>\Music\iTunes install iTunes and all should be fine.
    tt2

  • Tutor: Adding a Prior Activity that does not link to a document

    When the docs are published, the Prior Activities come across as broken links if a document filename is not included in the formatting.
    Is there a way around this so that if someone clicks on a prior activity which is not linked to a document, it doesn't do anything - rather than appearing as a broken link?
    Thank you.

    Can you provide the exact text that you are putting under the Prior Activity heading?
    Kind regards,
    Emily

  • IPHONE 4S incoming calls go directly to voice mail. This is a brand new replacement phone. Prior phone didn't have this problem

    IPHONE 4S incoming calls go directly to voice mail. This is a brand new replacement phone. Prior phone didn't have this problem

    Slide up from the bottom of your display to access the control panel.
    Look for the button (should be at the top) that shows a crescent moon.
    Tap that button. It should say "Do not Disturb: Off".
    Then try it out and let us know if it worked.

  • MODEL clause using CONNECY BY PRIOR

    Hello.
    I have the following table, CONTEXT_MAPPING:
    Name Null? Type
    ID NOT NULL NUMBER(38)
    CONTEXT_ITEM NOT NULL VARCHAR2(30)
    ID_1 NUMBER(38)
    ID_2 NUMBER(38)
    ID_3 NUMBER(38)
    ID_4 NUMBER(38)
    ID_5 NUMBER(38)
    It's a self referencing table, i.e. ID_1 will refer to an ID from another row in CONTEXT_MAPPING, and the same for ID_2/3/4/5.
    Easily illustrated through the following hierarchical data:
    ID CONTEXT_ITEM ID1 ID2 ID3 ID4 ID5
    1 P_DMA_NDA_ID
    2 P_DS_NDA_ID 1
    3 P_AST_NDA_ID 2 1
    4 P_AGI_ID 3
    5 P_ASG_NDA_ID 3
    6 P_NTS_FACTS 5 5
    7 P_IDE_VALUE 2 1
    8 P_EIT_VALUE 2 1
    9 P_TRI_TABLE 4 6 7 8
    10 P_TRI 9
    11 P_PRICE1 6 10 6
    12 P_PRICE2 6 10 6
    What I want to do, is for any context item, to identify ALL of its dependencies throughout the tree.
    For example:
    P_PRICE2 has a link to P_NTS_FACTS (ID1 & ID3 = 6) and P_TRI (ID2 = 10)
    P_NTS_FACTS has a link to P_ASG_NDA_ID (ID1 & ID2 = 5), which in turn links to P_AST_NDA_ID (ID1 = 3)...
    P_TRI has a link to P_TRI_TABLE (ID1 = 9), which in turn links to multiple context items (ID1 = 4, ID2 = 6 etc.) ....
    ....and so on, until we get to the "root" record, P_DMA_NDA_ID.
    So, to see the complete dependency tree for P_PRICE2, I would expect to see a hierarchical result-set like this:
    ID CONTEXT_ITEM ID1 ID2 ID3 ID4 ID5
    12 P_PRICE2 6 10 6
    10 P_TRI 9
    9 P_TRI_TABLE 4 6 7 8
    4 P_AGI_ID 3
    6 P_NTS_FACTS 5 5
    5 P_ASG_NDA_ID 3
    3 P_AST_NDA_ID 2 1
    7 P_IDE_VALUE 2 1
    8 P_EIT_VALUE 2 1
    2 P_DS_NDA_ID 1
    1 P_DMA_NDA_ID
    Ideally I want to do this in a single SQL statement - I've tried using CONNECT BY PRIOR in conjunction with LEVEL to do this, but it only performs a hierarchical join for a single child-parent relationship, and I need this to work for up to five children.
    Was starting to wonder if I could use the MODEL clause in conjunction with CONNECT BY PRIOR to achieve this - does anyone have any idea whether this type of recursion is possible?
    Thanks,
    Ray

    it only performs a hierarchical join for a single child-parent relationshipBeg to differ.
    Oracle Database 10g Release 10.2.0.2.0 - Production
    SQL> CREATE TABLE context_mapping (
      2     id NUMBER(38),
      3     context_item VARCHAR2(30),
      4     id_1 NUMBER(38),
      5     id_2 NUMBER(38),
      6     id_3 NUMBER(38),
      7     id_4 NUMBER(38),
      8     id_5 NUMBER(38));
    Table created.
    SQL> INSERT INTO context_mapping VALUES (1, 'P_DMA_NDA_ID', NULL, NULL, NULL, NULL, NULL);
    1 row created.
    SQL> INSERT INTO context_mapping VALUES (2, 'P_DS_NDA_ID', 1, NULL, NULL, NULL, NULL);
    1 row created.
    SQL> INSERT INTO context_mapping VALUES (3, 'P_AST_NDA_ID', 2, 1, NULL, NULL, NULL);
    1 row created.
    SQL> INSERT INTO context_mapping VALUES (4, 'P_AGI_ID', 3, NULL, NULL, NULL, NULL);
    1 row created.
    SQL> INSERT INTO context_mapping VALUES (5, 'P_ASG_NDA_ID', 3, NULL, NULL, NULL, NULL);
    1 row created.
    SQL> INSERT INTO context_mapping VALUES (6, 'P_NTS_FACTS', 5, 5, NULL, NULL, NULL);
    1 row created.
    SQL> INSERT INTO context_mapping VALUES (7, 'P_IDE_VALUE', 2, 1, NULL, NULL, NULL);
    1 row created.
    SQL> INSERT INTO context_mapping VALUES (8, 'P_EIT_VALUE', 2, 1, NULL, NULL, NULL);
    1 row created.
    SQL> INSERT INTO context_mapping VALUES (9, 'P_TRI_TABLE', 4, 6, 7, 8, NULL);
    1 row created.
    SQL> INSERT INTO context_mapping VALUES (10, 'P_TRI', 9, NULL, NULL, NULL, NULL);
    1 row created.
    SQL> INSERT INTO context_mapping VALUES (11, 'P_PRICE1', 6, 10, 6, NULL, NULL);
    1 row created.
    SQL> INSERT INTO context_mapping VALUES (12, 'P_PRICE2', 6, 10, 6, NULL, NULL);
    1 row created.
    SQL> SELECT DISTINCT id, context_item, id_1, id_2, id_3, id_4, id_5
      2  FROM   context_mapping
      3  START WITH id = 12
      4  CONNECT BY id IN (PRIOR id_1, PRIOR id_2, PRIOR id_3, PRIOR id_4, PRIOR id_5)
      5  ORDER BY id DESC;
            ID CONTEXT_ITEM                         ID_1       ID_2       ID_3       ID_4       ID_5
            12 P_PRICE2                                6         10          6
            10 P_TRI                                   9
             9 P_TRI_TABLE                             4          6          7          8
             8 P_EIT_VALUE                             2          1
             7 P_IDE_VALUE                             2          1
             6 P_NTS_FACTS                             5          5
             5 P_ASG_NDA_ID                            3
             4 P_AGI_ID                                3
             3 P_AST_NDA_ID                            2          1
             2 P_DS_NDA_ID                             1
             1 P_DMA_NDA_ID
    11 rows selected.
    SQL>

  • How do you invoke an Action prior to an initial page?

    Is there a mechanism in JSF that allows action code to run prior to the first page?
    Basically I want to do some processing in the context of JSF before displaying the initial application page.
    In Struts I was able to do this by defining an action-mappings action that referenced an action class, and from that action I could forward to another action-mappings action that was a JSP.

    This seems rather complicated and is not straight-forward. I need something similar: Before the first Render Response phase of a view I'd like my application to process any parameters that were passed via a non-faces GET request and set up my application and the JSF components appropriately. In other words, instead of the initial Restore View -> Render Response I'd like to have the full sequence of Restore View -> Apply Values -> Process Validations -> Update Model Values -> Invoke Application -> Render Response.
    For example, depending on the request parameters I'd like to forward the request to one or the other JSF view. And I cannot do that in the Render Response phase because doing it The Faces Way is only possible in the Invoke Application phase - which is not invoked upon a view's initial use.

  • How do I connet my time capsule to a new network

    Hey,
    I have a Time Capsule, which is set up to my old wifi. Now I have moved, and my Macbook works with the new wifi, but I can't connet my Time Capsule, my computer can't even find it. How do I setup my time capsule to the new wifi?
    Please help me.....

    The best way is to plug the TC by ethernet to main router in the new place. Reset it to factory.. see instructions and then it will appear in your airport utility.
    You cannot connect to two different wifi signals at the same time.. if you "join the wireless" the TC will perform poorly.
    Universal Factory Reset.. any model TC or AE.
    Unplug your TC/AE from power or turn off at the power point.
    Hold in reset. and power the TC/AE back on..  all without releasing reset and keep holding in for about 10sec. (this is often difficult without a 2nd person or a 3rd arm).
    Release it when the status light flashes rapidly. If it doesn’t flash rapidly you have missed it and try again.
    Note..
    Be Gentle! Feel the switch click on. It has a positive feel..  add no more pressure after that.
    TC/AE will reboot after a couple of minutes with default factory settings and will wipe out previous configurations of the router.
    No files are deleted on the hard disk in a TC.. No reset of the TC deletes files.. to do that you use erase from the airport utility.

  • HT1399 Why cant I create a playlist for my music/song videos? Continuous play is also not possible in the video app on the phone!!!! previously, prior to IOS 6, it was possible to have both music videos & songs mixed in the same playlist in the music app

    Why cant I create a playlist for my music/song videos? Continuous play is also not possible in the video app on the phone!!!! previously, prior to IOS 6, it was possible to have both music videos & songs mixed in the same playlist in the music app

    I am back with an update. I turned off Match on both the ipad and the iphone 5. By doing so I was able to sync my Iphone and ipad to itunes and store the music on my devices rather than the slow streaming.  So far this has fixed my problems with the iphone I have all my music, playlist, most of the album art and so on.  But the ipad is a different story.  I have the music and artist but not one playlist  I am sure Apple will have an upgrade soon that will address these issues they are usually very good about this. 
    Now have any of you experienced another problem that has existed as long as I have used faces in Aperture.
    I have over 200 faces and they are organized a-z problem is I have this going on A-Z folowed by a few that start over A-Z followed by another few A-Z and again a 4th time A-Z.  Imagine how difficult it is while I am showing someone the great features of my iphone, ipad and imac.  Which I do talk highly of all the time.  But how do I explain that even though their name starts with a or b or what ever they are not important enough to me to be in the first list of A-Z or even the 2nd or 3rd list of A-Z someohow they are in the 4th section of the list!!!!
    I have managed to get the Imac to fix this but for some reason the IOS devices do not.   Any ideas?
    Thanks Al

  • Since upgrading to Firefox 4, when I printed anything, I got a gray background covering the page. What I printed could be seen, but it wasted a lot of ink. I had to 'downgrade' to the prior version of Firefox; if it won't be supported soon, what do I do?

    I am using Windows XP, SP3. I have experienced this printing problem with anything I print from the internet, any site. I can read whatever I am printing, but there is a light gray background on the whole page. I saw something similar in the problems already listed in the help section, but the fix in the about:config files did not help; same problem existed. The only thing that fixed it was to uninstall Firefox 4, and reinstall the prior version. I am now using version 3.6.17. I have read the warning when I start Firefox to seriously consider upgrading to version 4, and that the older version won't be supported, but since I can't print from it without wasting considerable ink, and having pages that are unattractive and difficult to use, I don't know what to do. Please help. I want to use the new version, but MUST be able to print clean pages, without a gray background on each one.

    I have had a similar problem with my system. I just recently (within a week of this post) built a brand new desktop. I installed Windows 7 64-bit Home and had a clean install, no problems. Using IE downloaded an anti-virus program, and then, because it was the latest version, downloaded and installed Firefox 4.0. As I began to search the internet for other programs to install after about maybe 10-15 minutes my computer crashes. Blank screen (yet monitor was still receiving a signal from computer) and completely frozen (couldn't even change the caps and num lock on keyboard). I thought I perhaps forgot to reboot after an update so I did a manual reboot and it started up fine.
    When ever I got on the internet (still using firefox) it would crash after anywhere between 5-15 minutes. Since I've had good experience with FF in the past I thought it must be either the drivers or a hardware problem. So in-between crashes I updated all the drivers. Still had the same problem. Took the computer to a friend who knows more about computers than I do, made sure all the drivers were updated, same problem. We thought that it might be a hardware problem (bad video card, chipset, overheating issues, etc.), but after my friend played around with my computer for a day he found that when he didn't start FF at all it worked fine, even after watching a movie, or going through a playlist on Youtube.
    At the time of this posting I'm going to try to uninstall FF 4.0 and download and install FF 3.6.16 which is currently on my laptop and works like a dream. Hopefully that will do the trick, because I love using FF and would hate to have to switch to another browser. Hopefully Mozilla will work out the kinks with FF 4 so I can continue to use it.
    I apologize for the lengthy post. Any feedback would be appreciated, but is not necessary. I will try and post back after I try FF 3.16.6.

  • I have a basic applet method timing problem with Firefox (and Chrome), not IE nor Opera. Works if JavaScript issues windows.alert() prior, fails otherwise.

    I have an applet method, which is invoked from a JavaScript function, that is triggered by the window.onload event. The problem seems to center in the loading of the applet and its methods.
    If I step through the 3 applet acceptance prompts (I chose to use a down-level Java), the applet method is never invoked, nor is an exception raised. How this happens is beyond my understanding.
    As additional information, the Init(), start(), and "desired" Java methods all use the synchronized keyword. This is an attempt to minimize the exposure to a multi-thread environment.
    If I issue a message from JavaScript (via window.alert()) PRIOR to invoking the method, I can get the desired results in special circumstances:
    1) When the alert is presented, Firefox also prompts, SIMULTANEOUSLY, to block/continue the applet (the first of the 3 applet acceptance prompts). I can accept that these are separate threads.
    2a) If I walk through the 3 applet acceptance prompts FIRST, and then hit the OK button on the alert message SECOND, I get the desired results, my applet method executes, and all is well (other than the fact that I would prefer not to have the alert in place at all).
    2b) If I hit the OK button on the alert message FIRST, and then walk through the 3 applet acceptance prompts SECOND, I get the same results as when the page loads WITHOUT the alert, which is the applet method is never invoked, nor is an exception raised. Weird, huh?
    The above problem only occurs when the browser and the applet's URL are loaded for the first time.
    Subsequent invocations (after the page & applet has been loaded initially) do not have the failing symptoms.
    It is my understanding that IE and Firefox (and Chrome and Opera, for that matter) each use the same implementation of JavaScript provided by Microsoft. Please correct me if this information is inaccurate.
    The failing page and it's applet are proprietary; I cannot provide the Internet URL, nor the Java or JavaScript source, to aid in your analysis.

    I can speak to the source code, but have no access to it.
    The current process/thread that invokes an applet method must check to see that the applet is not currently being loaded by another process/thread. If it is being loaded, the current process/thread should block until the load is complete, THEN attempt to invoke the applet method.
    Please forward my concern to a knowledgable developer. The nature of the problem, once identified, can be addressed in a very straightforward manner.

Maybe you are looking for

  • BPM WorkSpace login issue

    Hello I was trying to login to my BPM Console: http://localhost:8001/bpm/workspace/faces/loginPage.jspx After logging in the page looks blank, does not show up any info in the page. Following is the log that has got reflected @ Weblogic level: Any is

  • Does Apple support UVD or PureVideo

    Both video cards available for the new iMacs support H.264 GPU decoding (UVD for ATI and PureVideo for nVidia) - does the quicktime player take advantage of them?

  • Can we buy project pro for office 365 even if we don't have Office 365 subscription?

    hi, can we buy project pro for office 365 even if we don't have Office 365 subscription? Thanks

  • Alert by mail or Alert by RWB alert inbox....

    Hi If  I am in setting -> configuration->Smtp forwarding as XML  in order to set up a mail for XI Alert error did that mean that won´t receive alert in the RWB alert Inbox ? Can I implement both of functionalities (alert by mail and alert in rwb aler

  • Adding application to firewall changes md5 sum

    I was playing World of Warcraft and the application stopped connecting to the server. Firefox worked, mail worked, even Ventrilo worked, but the warcraft app would not connect. I figured maybe i needed to add the application to the firewall exclusion