Header and Child needed - but underlying records are the same.

Hi people,
I am trying to figure out how to do this particular sort of problem. I have given the create and the insert scripts for creating the sample data for the same.
1. I have 3 records as given below. This is just sample data but based on something that I am trying
create table t
(id number,
sub_id number,
Name varchar2(50),
Desciption varchar2(100),
val number
SQL> insert into t values (1,1,'Test First', 'Test First Description', 10);
1 row created.
SQL> insert into t values (1,1,'Test First', 'Test First Description', 9);
1 row created.
SQL> insert into t values (1,1,'Test First', 'Test First Description', 15);
1 row created.
SQL> select * from t;
        ID     SUB_ID NAME                 DESCIPTION                       VAL
         1          1 Test First           Test First Description            10
         1          1 Test First           Test First Description             9
         1          1 Test First           Test First Description            15
2. I need to create an output, that looks like this
Output
Hdr          Test First           Test First Description
Chd          10
Hdr          Test First           Test First Description
Chd          9
Hdr          Test First           Test First Description
Chd          15Now maybe the logic is very simple, but I have been trying for a couple of hours now and have not been able to put my finger on it.
Would appreciate if any of you could help.
Regards,
K

SQL> drop table test;
Tabel is verwijderd.
SQL> create table test(id number,sub_id number,Name varchar2(50),Desciption varchar2(100),val number
Tabel is aangemaakt.
SQL>
SQL> insert into test values (1,1,'Test First', 'Test 10 First Description', 10);
1 rij is aangemaakt.
SQL>
SQL> insert into test values (1,1,'Test First', 'Test 9 First Description', 9);
1 rij is aangemaakt.
SQL>
SQL> insert into test values (1,1,'Test First', 'Test 15 First Description', 15);
1 rij is aangemaakt.
SQL>
SQL> with x
  2  as
  3  (select name, desciption, val, row_number() over (order by id, sub_id, val) rn
  4    from test
  5  )
  6  select indicator, name, desciption
  7    from (
  8  select 'Hdr' indicator, name, desciption, rn
  9    from x
10  union all
11  select 'Chd', to_char (val), null, rn
12    from x
13    )
14  order by rn, indicator desc
15  ;
IND NAME                                               DESCIPTION
Hdr Test First                                         Test 9 First Description
Chd 9
Hdr Test First                                         Test 10 First Description
Chd 10
Hdr Test First                                         Test 15 First Description
Chd 15
6 rijen zijn geselecteerd.
SQL>

Similar Messages

  • HT1386 I can't synchronise phone 5s with mac book pro. mac message me : the i phone could not be synchronised because this computer is no longer authorised for purchased items that are on this i phone. then go and authorised mac but keep send me the same

    I can't synchronise phone 5s with i tunes . mac message me : the i phone could not be synchronised because this computer is no longer authorised for purchased items that are on this i phone. then go and authorised mac but keep send me the same message.

    Hi john,
    Follow the troubleshooting steps in this article:
    http://support.apple.com/kb/ts1389
    Cheers,
    GB

  • TS1538 I have tried everything but I can't connect my iphone to my laptop. It says that apple mobile device failed to be installed. I have read everything on the internet and did everything but still am facing the same problem. Can you please help me.

    I have tried everything but I can't connect my iphone to my laptop. It says that apple mobile device failed to be installed. I have read everything on the internet and did everything but still am facing the same problem. Can you please help me.

    Again without stating the trouble shooting steps you have taken, its hard to direct you with any information.
    Try a different port on the computer.
    Does the iphone beep when u plug it up. ?
    Plug iphone into computer and give it 3 to 4 minutes to see if it connects and is running slow.,
    Delete the apple mobile device from your computer.
    Upgrade itunes to newest version.
    Is you USB cord defective ?
    Any USB 3.0 on your system ? .
    Delete or Disable  any antivirus program on your computer ?
    I will tell u the problem is your computer not the phone.
    We could do this for hours.

  • Is Photoshop Elements the same as Photoshop? I am brand new and have no idea if they are the same or

    Is Photoshop Elements the same as Photoshop? I am brand new and have no idea if they are the same or different or what!

    Photoshop Elements is a subset of the features found in full Photoshop, and with an organizing component that isn't part of the big program (which includes a deluxe file browser, Bridge, rather than the Organizer found in Elements). More info here:
    http://forums.adobe.com/thread/1038467

  • I have kids ipods and my iphone but i dont want the same apps to go o these product how can i do this/

    i have kids ipods and my iphone but i dont want the same apps to go o these product how can i do this/

    Also, if you sync to the same computer/iTunes library use the manual method so only checked items sync to the device
    Managing content manually on iPhone, iPad, and iPod

  • Everytime I try to open firefox, it just doesnt open up. no matter how many times I click it. I tried uninstalling it and reinstalling it, but it continues with the same problem. what should I do?

    Everytime I try to open firefox, it just doesnt open up. no matter how many times I click it. I tried uninstalling it and reinstalling it, but it continues with the same problem. what should I do?

    You can disable autoupdate by following these steps:
    Go to main menu > Tools > Options > click on Advanced tab > click on Update tab and then click on the round radio button that says ''Never check for updates (not recommended: security risk)''
    Refer the attached screenshot

  • Is there and ipad app that allows you to record and edit audio, but can record in the background?  This would be to record voiceover auditions/podcasts while reading a script

    Hi wondering if anyone might be able to help me out.  I am an audio engineer and my wife is a voiceover artist.  We just got the ipad thinking she could record her voiceover auditions on the go, but we can't for the life of us figure out how to record audio while reading a script off of her email.
    Looking for an app that:
    Either can record audio while in the background (garageband cannot)
    OR Import text (copy paste I guess?) to read while recording
    The app needs to  be able to edit audio and export or email out an MP3 - by edit audio I mean trim, fades, and move around sections.
    Anyone have any thoughts on how to do this?  I have been looking around the web for answers for hours and can't find any.  Thanks in advance for your help.

    Hi-  I've done a lot of research in this area and actually am just finishing a book on this subject which will soon be in the iBookstore.
    The best app is TwistedWave.  It allows easy editing and recording, and also allows you record while you are in another app (such as a script your agent sent in your email)
    I recommend MiC by Apogee as your microphone, available at the Apple store.
    My book which goes in depth in how to get the best sound as well as how to edit is called:
    iVoiceover
    Super. Simple. Recording.
    I'll post here when it's live in the iBookstore!

  • Firefox 7, on Windows 7. It's suddenly stopped all downloads, picture saves etc. I uninstalled it, and reinstalled it, but it's still the same. Any ideas as to what to do, please?

    I've now got Firefox 8 - so could, I guess, try installing that, instead. This problem happened quite suddenly, in the middle of a browsing session. I'm not so happy with the alternatives (Opera,IE and Chrome), and love Firefox, so would like to put this problem right! I'm using an Acer notebook One 722, by the way. Grateful for any help! Thanks! John (a Brit in Poland)

    A possible cause is security software (firewall) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process and the updater process.
    See:
    * https://support.mozilla.com/kb/Server+not+found
    * https://support.mozilla.com/kb/Firewalls
    * http://kb.mozillazine.org/Error_loading_websites

  • My iPhoto app says unable to open.  I have 10.7.4 OS and the iPhoto version is 9.2.3  I have tried updating and reinstalling app but I still get the same message

    I updated everything and triedn reinstalling the iphoto app and I still get the message "iphoto can not open due to a problem".  The message says that there may be compatiblilty issues with OS and Iphoto.  I updated everything like it suggested and still doesn't work.  Any suggestions?  I'm making an appointment at Apple store to see if they can fix the issue....I was hoping to do it on my own....

    Did you delete the receipts before re-installing?

  • Suddenly on DellXPS15z laptop reading email Firefox or IE Zoom goes from 100% serially down to an unreadable 35%. Size can increased with Ctrl and +/= keys. But then it repeats the same downsizing routine.

    '''bold text'''

    Hi Alex,
    Take a look at this document, and select the appropriate scenario and try the troubleshooting steps.  Please let me know if it helps you resolve the problem.
    Good luck!
    ↙-----------How do I give Kudos?| How do I mark a post as Solved? ----------------↓

  • Imac 2g 6970m render time it takes 1 hour and 20 munites but when i render the same video on windows pc and its have gt640 render time falls to 4 munites shats my macs problem

    is there any problem about my graphics card what is the problem maveriks hdd cpu

    is there any problem about my graphics card what is the problem maveriks hdd cpu

  • *Fix* Usage and Standby Times are the same - iPhone 4S 7.0.4

    I'd like to share my experience here because I actually found the solution on here but I'm actually having trouble finding it again.
    I had three problems:
    1. My standby and usage times were always reporting the same values, thus draining my battery faster than usual. This is not normal behavior; whenever the screen is off it should report standby times, and after the phone is unlocked it is considered usage. They should never be recording in tangent.
    2. Whenever I would try to turn off my phone by holding down the power button, the phone would basically restart itself, showing the Apple logo boot screen and then restarting. The only caveat was that it would turn off if it was plugged in and being charged. But take it off the charger and try to replicate it turning off and it would restart.
    3. The sound would sometimes think that it was connected to a Dock, so when I went to the Airplay options, they were listed as Dock Connector, Airport Express and Apple TV. There would be no volume slider in the Control Center, and when pressing the volume buttons, there would be no dots, just the bell with a line through it.
    Many people might be having genuine battery issues, where you have an older phone and your battery is just really bad and needs to be replaced. My 4S was still under AppleCare in December 2013 and the battery was pretty bad, so I had it replaced in an Apple Store. So for me, the battery life itself was not the problem.
    I tried a lot of things to try and fix the above problem but none of them helped. This includes chatting with Apple support (I was surprised they didn't steer me in an obvious direction, considering the large amount of folks who were having these kinds of problems, but they played dumb), restoring fresh and restoring icloud and itunes backups, all kinds of combinations of settings for Mail, iCloud, etc., but nothing worked. I probably restored my phone at least ten times in my troubleshooting efforts. The isolated test of restoring my phone fresh, setting it up to the start screen, making sure the battery was charged 100% and taking it off the charger waiting about 10 minutes. Then I would check standby and usage times.
    I had read about fixes for the phone not being able to turn completely off, and it had something to do with cleaning the charging port. I attempted to clean the port with compressed air and other methods, but it never fixed this problem. Then I read a post on Apple Support about a guy who had the exact same problems as I did, then said he changed out his charging port and this fixed it. Well, it was $40 so I paid someone to do it in 45 minutes.
    After I got my phone back the problem didn't appeared to be fixed, but after a restore and even with an icloud backup restored with it, I looked down at my phone and presto chango, the times where separate and working as they should. Last night with wifi off while I was sleeping, the battery only went down 3%. I know this is turning out to be a narrative, but I spent a lot of time trying to figure out what the problem was and it was a frustrating process. I'm happy it's resolved.
    Apple Support thought it was a corrupt install package from iTunes, or some kind of software glitch or maybe some part of iCloud constantly trying to call home, but it was a combination of both hardware and software. Because of the bad charging port, for some reason the phone thought it was still being used and thus was still treating standby as usage.
    I would encourage those that are having this problem to do a test and see if your phone will turn off when you want it to. If it resets automatically and if your standby usage times are the same, replacing the charging port might fix it.

    Ever since iOS7.0.6. and still on iOS7.1 both me and my wife had huge battery drain on our iPhone 4S and stand-by was equal to usage time. We finally found the solution to a post of another user on the Dutch Tweakers forum. There seem to be a bug within a certain Dutch coupon app called 'Scoupy' which drained the battery completely although GPS setting was turned of and also 'refresh on background' was off.
    Scoupy said that a fix for their app is send for approval to the App Store. We removed the app and our usage/stand-by time is again as normal (higher stand-by time then usage time) and best of all a 'normal' battery use as it was the case on iOS7.0.4. I hope this could help someone. I'm wondering if the iBeacon changes in iOS7.0.6/7.1 together with a bug in the Scoupy app could be the cause? Maybe this is also with our similar apps you have on your phone.

  • Line item and header records in the same infopackage

    Gurus,
    I wanted to check how can I make sure that I get all the line item documents in the same package with the header document record in the same infopackage? Is there some setting for that? If I am writing a custom extractore how can I make sure of this in ABAP?
    Thanks
    AK

    Dear AKBW,
    This is not very clear why you want to use same infopackage for line-item as well as header data. Normally there are 2 different datasources for line item and for header data.
    Say you are woking with Sales Order Data in ECC.
    So Line-item datasource for sales order data - 2LIS_11_VAITM
    and Header datasource for sales order data - 2LIS_11_VAHDR.
    Now as they are 2 different datasource, so you must need 2 different infopackages.
    Now if you have created one custom datasource in ECC, then just check if its extracting line-item level or header level data. Normally when we create any custom datasource, we try to make it line-item level, to have all the itemwise detail. Though its not mandatory.
    So if you have 2 different datasources (SAP or Custom), you definitely need 2 different infopackages.
    Please let me know, if you still have any more doubt. You can also give me the other detail of the custom datsource you are creating.( type, fields, what it is supposed to extract etc)..

  • Loading date different in SBOM Header and Child Material.

    Hi All,
    We are implementing the SBOM Functionality for our Client. We are facing unusual issue while going through a Testing Phase. We are using the same SBOM Master data for all our testing purpose. I have created 4 Sales Orders for same SBOM Material.  In some Sales Orders I am getting same Loading Date for SBOM Header and Chil Materail in Shipping Tab Page in Overview Screen. In some Sales Orders we are getting different Loading date for SBOM header and Child Item.. I have enclosed the details in the attached document with screen shot
    I have check all configurations of Availabilty Check. Why the system is giving dates inspite of using same SBOM Master data in other Sales Order.
    Please could you help in fixing this Issue where I need to make the changes. so I could get same dates for both. I am uable to attach the document in which I have given the screenshots.
    Thanks
    Farhan.

  • I'm trying to register for an iCloud account with my apple ID but it's telling me it needs to be an email address. I try and amend my username so it's the same as my email address but nothing happens! HELP?!

    Hi - I'm trying to register for an iCloud account (I've just had a baby and am terrified I'm going to lose all my photos of him!) but when I try and register, it tells me it needs an email address so I go to edit my username and try and amend it so my email address and username are the same thing but nothing is happening.  I keep going round in circles - can someone help?!

    Where are you trying to amend your username?
    It should be done at http://appleid.apple.com/

Maybe you are looking for

  • Actions from CS5 fail in CS6

    Using CS6 v13.0 x64 on a Win 7 ^4 bit PC with 12Gb RAM. I have actions that call for an image to be opened, selected, copied, the image closed and the "clipboard" image pasted into another, already open, image in PS.  This works without fail in CS5 b

  • Display blacks out when panel is extended

    My pbg4 screen turns black (no light) when the display panel is open about 80 degrees or further. Just started...like a short in a wire. Sound familiar? Any help on downloading instructions to remove display panel will be appreciated.

  • FMS Authentication Add-in (optional)

    Hi all. I downloaded auth_addin_win_v2.6.msi and installed it. But my encoder required me ID and Pass. How can i to configure this ID and Pass in my FMS. Thank you.

  • ITunes won't update

    When I try to update through iTunes and after it downloads it says an error has occurred try and download again. Then I went on apple.com and tried that way and the installer downloaded. Then when it tried to download after a while it says an error o

  • Target file size changes

    Hi experts, In my scenario the file that gets created in the target dir has shown the following pattern. Expected size: 250MB first the file got created with 4MB size then it went to 0MB n then raised again to 4MB n then again went to 2MB and after f