Pivot SQL --Pls advise

Select distinct a.forename as "Name",
a.surname as "Surname",
a.forename ||''||a.surname as "Fullname",
b.ancestors as "Ancestors",
Other columns ..
from table1 a,table2 b,table3 c,table4 d...
where a.col1 =b.col1 and ..(other conditions)
Output is as follows:
Forename1 Surname1 Fullname1 Ancestor1 Other columns
Forename1 Surname1 Fullname1 Ancestor2 Other columns
Forename1 Surname1 Fullname1 Ancestor3 Other columns
Forename1 Surname1 Fullname1 Ancestor4 Other columns
required output is
Forename1 Surname1 Fullname1 Ancestor1/Ancestor2/Ancestor3/Ancestor4 Other columns
I am new to Pivot concept and never used it.
Please help in modifying query.
thanks in advance.

The ability to generalise from the specific - in this case the ability to figure out a solution to your problem by examining a solution to someone else's similar problem - is vital in the world of IT.
How about developing your skills in that area by searching the forum for PIVOT or rows+to+columns and see what you can come up with? Even if you can't quite figure it out, we'll be happy to help you over the finish line once you post your query. I suspect that SYS_CONNECT_BY_PATH is actually going to be worth investigating rather than pivot, given your description of the desired output.

Similar Messages

  • 11.5.10.2 to R12.1.1 upgrade: jtfpfstart.sql : PLS-00905: object APPS.JTF_PF_CONV_PKG is invalid

    Hello,
    EBS version : 11.5.10.2
    DB version : 11.2.0.3
    OS version : AIX 6.1
    As a part of 11.5.10.2 to R12.1.1 upgrade, while applying merged 12.1.1 upgrade driver(u6678700.drv), we got below error :
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ATTENTION: All workers either have failed or are waiting:
               FAILED: file jtfpfstart.sql on worker  1.
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Worker LOG :
    Start time for file is: Wed Aug 07 2013 14:53:36
    sqlplus -s APPS/***** @/fmstop/r12apps/apps/apps_st/appl/jtf/12.0.0/patch/115/sql/jtfpfstart.sql &un_apps &un_jtf
                dbms_aqadm.drop_queue_table(queue_table=>JTF_PF_CONV_PKG.QTABLENAME, force=>true);
    ERROR at line 23:
    ORA-06550: line 23, column 47:
    PLS-00905: object APPS.JTF_PF_CONV_PKG is invalid
    ORA-06550: line 23, column 6:
    PL/SQL: Statement ignored
    ORA-06550: line 27, column 45:
    PLS-00905: object APPS.JTF_PF_CONV_PKG is invalid
    ORA-06550: line 27, column 2:
    PL/SQL: Statement ignored
    ORA-06550: line 28, column 38:
    PLS-00905: object APPS.JTF_PF_CONV_PKG is invalid
    ORA-06550: line 28, column 2:
    PL/SQL: Statement ignored
    ORA-06550: line 29, column 39:
    PLS-00905: object APPS.JTF_PF_CONV_PKG is invalid
    ORA-06550: line 29, column 2:
    PL/SQL: Statement ignored
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    So far I have done below :
    SQL> ALTER PACKAGE APPS.JTF_PF_CONV_PKG compile;
    Warning: Package altered with compilation errors.
    SQL> show error
    Errors for PACKAGE APPS.JTF_PF_CONV_PKG:
    LINE/COL ERROR
    30/3     PL/SQL: Declaration ignored
    30/39    PLS-00201: identifier 'JTF_PF_PAGE_OBJECT_TABLE' must be declared
    66/3     PL/SQL: Declaration ignored
    66/33    PLS-00201: identifier 'JTF_PF_TABLETYPE' must be declared
    SQL> ALTER PACKAGE APPS.JTF_PF_CONV_PKG compile body;
    Warning: Package Body altered with compilation errors.
    Found Upgrade 11i to R12.1.3 worker fails on jtfpfstart.sql PLS-00905: object APPS.JTF_PF_CONV_PKG is invalid (Doc ID 1463373.1) which has fixed JTF_PF_TABLETYPE.
    drix10:/fmstop/r12apps/apps/apps_st/appl/admin/FMSTEST/log>cd $JTF_TOP/patch/115/xdf
    drix10:/fmstop/r12apps/apps/apps_st/appl/jtf/12.0.0/patch/115/xdf>tnsping $TWO_TASK
    TNS Ping Utility for IBM/AIX RISC System/6000: Version 10.1.0.5.0 - Production on 07-AUG-2013 15:03:59
    Copyright (c) 1997, 2003, Oracle.  All rights reserved.
    Used parameter files:
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=drix10)(PORT=1541)) (CONNECT_DATA=(SID=FMSTEST)))
    OK (0 msec)
    drix10:/fmstop/r12apps/apps/apps_st/appl/jtf/12.0.0/patch/115/xdf>
    drix10:/fmstop/r12apps/apps/apps_st/appl/jtf/12.0.0/patch/115/xdf>adjava -mx512m -nojit oracle.apps.fnd.odf2.FndXdfCmp apps apps \
    > apps apps thin drix10:1541:FMSTEST type \
    > jtf_pf_tabletype.xdf $FND_TOP/patch/115/xdf/xsl
                         Copyright (c) 2002 Oracle Corporation
                            Redwood Shores, California, USA
                                        AD Java
                                     Version 12.0.0
    NOTE: You may not use this utility for custom development
          unless you have written permission from Oracle Corporation.
    Reading product information from file...
    Reading language and territory information from file...
    Reading language information from applUS.txt ...
      Temporarily resetting CLASSPATH to:
      "/fmstop/r12apps/apps/apps_st/appl/ad/12.0.0/java/adjava.zip:/fmstop/r12apps/apps/tech_st/10.1.3/appsutil/jdk/lib/dt.jar:/fmstop/r12apps/apps/tech_st/10.1.3/appsutil/jdk/lib/tools.jar:/fmstop/r12apps/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/rt.jar:/fmstop/r12apps/apps/apps_st/comn/java/lib/appsborg.zip:/fmstop/r12apps/apps/tech_st/10.1.2/forms/java:/fmstop/r12apps/apps/tech_st/10.1.2/forms/java/frmall.jar:/fmstop/r12apps/apps/tech_st/10.1.2/jlib/ewt3.jar:/fmstop/r12apps/apps/tech_st/10.1.2/j2ee/OC4J_BI_Forms/applications/formsapp/formsweb/WEB-INF/lib/frmsrv.jar:/fmstop/r12apps/apps/apps_st/comn/java/classes"
      Calling /fmstop/r12apps/apps/tech_st/10.1.3/appsutil/jdk/jre/bin/java ...
    XDF file application started. Current time is: Wed Aug 07 15:04:40 CDT 2013
    ================================================================================
    Applying XDF file : jtf_pf_tabletype.xdf
    ================================================================================
                  Copyright (c) 2003 Oracle Corporation
                     Redwood Shores, California, USA
             XDF(XML Object Description File) Comparison Utility
                            Version 1
    NOTE: You may not use this utility for custom development
          unless you have written permission from Oracle Corporation.
    Type JTF_PF_TABLETYPE does not exist in APPS
    Creating Type
          CREATE OR REPLACE TYPE "APPS"."JTF_PF_TABLETYPE" as table of varchar2(2000);
    Start time for statement above is Wed Aug 07 15:04:40 CDT 2013
    End time for statement above is Wed Aug 07 15:04:41 CDT 2013
    SQL> ALTER PACKAGE APPS.JTF_PF_CONV_PKG compile;
    Warning: Package altered with compilation errors.
    SQL> show error
    Errors for PACKAGE APPS.JTF_PF_CONV_PKG:
    LINE/COL ERROR
    30/3     PL/SQL: Declaration ignored
    30/39    PLS-00201: identifier 'JTF_PF_PAGE_OBJECT_TABLE' must be declared
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    I could not see any doc on metalink or google talking about JTF_PF_PAGE_OBJECT_TABLE.
    Please help.

    Please try the following:
    1. Drop the following objects (take a backup of the tables first) using:
    SQL> create table JTF.JTF_PF_REPOSITORY_TMP_BKP as select * from JTF.JTF_PF_REPOSITORY_TMP;
    SQL> create table JTF.JTF_PF_REPOSITORY_BKP as select * from JTF.JTF_PF_REPOSITORY;
    SQL> drop table JTF.JTF_PF_REPOSITORY_TMP;
    SQL> drop table JTF.JTF_PF_REPOSITORY;
    SQL> drop synonym APPS.JTF_PF_REPOSITORY_TMP;
    SQL> drop synonym APPS.JTF_PF_REPOSITORY;
    2. Run the jtfpfcreate command:
    $ sqlplus -s apps/<apps_pws> @$JTF_TOP/patch/115/sql/jtfpfcreate.sql APPS JTF
    3. Recreate the missing objects:
    $ adjava -mx512m -nojit oracle.apps.fnd.odf2.FndXdfCmp apps apps apps apps thin "<hostname>:<port>:<SID>" all $JTF_TOP/patch/115/xdf/jtf_pf_tabletype.xdf $FND_TOP/patch/115/xdf/xsl
    $ adjava -mx512m -nojit oracle.apps.fnd.odf2.FndXdfCmp apps apps apps apps thin "<hostname>:<port>:<SID>" all $JTF_TOP/patch/115/xdf/jtf_pf_page_object_table.xdf $FND_TOP/patch/115/xdf/xsl
    $ adjava -mx512m -nojit oracle.apps.fnd.odf2.FndXdfCmp apps apps apps apps thin "<hostname>:<port>:<SID>" all $JTF_TOP/patch/115/xdf/jtf_pf_techstack_table.xdf $FND_TOP/patch/115/xdf/xsl
    $ adjava -mx512m -nojit oracle.apps.fnd.odf2.FndXdfCmp apps apps apps apps thin "<hostname>:<port>:<SID>" all $JTF_TOP/patch/115/xdf/jtf_pf_trackpurpose_table.xdf $FND_TOP/patch/115/xdf/xsl
    4. Drop unused queue objects:
    begin
    DBMS_AQADM.DROP_QUEUE_TABLE (queue_table => 'JTF_PF_LOGGING_TABLE', force => TRUE);
    end;
    5. Restart the failed worker using adctrl
    Regards,
    Hussein

  • PIVOT sql help

    Hi again
    I need some PIVOT sql help
    In this query:
    SELECT
    SUM([RATES]) as RATES
    ,SUM([CONVERSION])as CONVERSION
    FROM REPORTING
    outputs
    RATES CONVERSION
    23 234
    How would change this query to display a table like:
    Name Amount
    RATES 23
    CONVERSION 234
    Keep up the good work !

    nikos101 wrote:
    > How would change this query to display a table like:
    Do you *HAVE* to change the query... you could just display
    it in the
    desired format if that it the ultimate and only goal.
    <table>
    <tr>
    <td>name</td>
    <td>amount</td>
    </tr>
    <cfoutput query="sumQry">
    <tr><td>Rates</td><td>#rates#</td></tr>
    <tr><td>Conversion</td><td>#conversion#</td></tr>
    </cfoutput>
    </table>

  • HT201269 I am trying to sync contacts from Apple Iphone to Android phone, I was trying to locate the sync contacts with google option but counld not find it in the itunes. Pls advise how do I do the sync, I need to sync the contacts and calendar too. Than

    Hi, I am trying to sync my Iphone contacts and calendar to my Samsung note 3 phone, saw in the U-tube that I can do it in itunes under the sync contacts with googles process. But I could not fine the sync contacts with process in the itunes. Can you pls advise me how I can sync my iphones contacts and calendar to my note 3 phone. Thanks

    http://support.apple.com/kb/HT1296

  • Pls its very urgent - i dropped by iphone 3G and the display became very dim soon after and it still remains the same - pls advise what should be done to bring the display back to normal

    Pls its very urgent - i dropped by iphone 3G and the display became very dim soon after and it still remains the same - pls advise what should be done to bring the display back to normal

    sounds like you broke the display when you dropped it.  There's nothing we users here can do for you.
    Since the iPhone warranty does not cover accidental damage, you will have to pay to have your phone repaired or replaced.  You can bring it into Apple for an out of warranty exchange in the country of purchase, or you can find a 3rd party iPhone repair store in your area.

  • I would like to cancel the Popular Science subscription. Pls advise what is the procedure

    I would like to cancel the Popular Science subscription. Pls advise what is the procedure.

    Cancel Subscription
    http://support.apple.com/kb/HT4098

  • I have lost all my contact telephone numbers and photos  after I connect to Itunes, Pls advise

    Dear Sirs,
    I had lost all my contact and photos after I connect to the PC Itunes. Pls advise how can I recover it.
    Thank you very much for yr kind assistance.
    Brgds
    Mary Gong

    Are you using iCloud as well as manually synchronizing via iTunes?
    And, do you have backup?

  • Pls advise how can I remove the 'Loading' icon.

    I have purchased a app called Kids Song All - 220 and I have downloaded it in itune as it has exceeded 20MB. But currently my iphone been showing "Loading'. Pls advise how can I remove the icon.

    @cor-el: Thank you for your help. Got the issue fixed.
    For those who are interested in a quick fix for this, go under (user profile depending on what OS you are using)\Mozilla\Firefox\Profiles\chrome , create a css file named userChrome.css (you have an example there... ) and paste in this code :
    @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
    #statusbar-display { display: none !important; }
    Not sure if it's really correct, but it removed that annoying Status-bar, so I'm satisfied with it.

  • Pls advise any report to retrieved the list of  STR/ PR  cancellation.

    Hi All,
    Pls advise any report to retrieved the list of  STR/ PR  cancellation via User ID.
    Thanks
    Chandru

    Hi,
    Since the cancellation data of all STRs and PRs is kept in Change document.  Therefore, you should run Transaction S_ALR_87101238 with object class BANF and at the report output, set the filter on the Field name ''LOEKZ''.
    Cheers,
    HT

  • Pls. advise me wht type of CONTENT i should use?

    Hello
    Pls. advise me wht type of CONTENT i should use for subform in question, pls. see the attached JPEG pic
    Thank you

    Check these samples:
    http://www.assuredynamics.com/index.php/portfolio/explore-the-differences-between-position ed-and-flowed/
    http://www.assuredynamics.com/index.php/portfolio/expanding-objects-in-flowed-subforms/

  • Pls advise current info as to combining 3 iMovie projects into one iMovie. Thanks!

    Pls advise current info as to combining 3 imovie projects into one imovie.  I will finish with idvd.
    I am in a rush today to complete a video for my brother's memorial for tomorrow.  Thanks!

    Thanks for your reply, Klaus. I'm just now getting to try your suggestion to copy and paste from timeline rather than drag and drop from clipviewer. Alas, it seems to be choking terribly on the transfer. This video is not a 60 minute movie, either; it's about ten minutes. I has about 60 files to it. I did get to the point where I felt confident enough to empty the trash and save the project, so I assume the clips that are there are not still "attached" to the unedited dvs.
    Earlier I tried to export, in the advanced settings, to the full quality dv, but the quality really dropped, way too much for the intended use. I'm pretty much stumped at this point, unless I can hear some other suggestions.
    What I might try doing is simply dragging and dropping all the packet contents of the media folder into the other movie's media folder, but then I suspect I'll have to rebuild the darn thing from bits and pieces and it may be like putting Humpty Dumpty back together again...ugh.
    I'm sure I'm not the first person to face this challenge, am I? Of course, my lesson learned is to build one dvd's contents in one imovie project. If it weren't for the fact that I need to offer viewers the option to "play movie" (play all the videos as one movie) I'd simply drag each movie into iDVD and do it that way (the dvd showing each video separately).
    Would still love to hear of other possible solutions here, before trying some other forum.
    thanks!
    B

  • IPhone 3GS iOS 6.1.3 -  camera doesn't work. Shutter won't open & camera button becomes disabled. Pls advise what to do? I have already tried resetting the phone several times.

    iPhone 3GS iOS 6.1.3 -  camera doesn't work. Shutter won't open &amp; camera button becomes disabled. Pls advise what to do? I have already tried resetting the phone several times.

    Hello Kunmon,
    The following article provides some useful troubleshooting that can help get your iPhone's camera working correctly.
    Camera isn't functioning or has undesired image quality
    If the screen shows a closed lens or black image, force quit the Camera app.
    If you do not see the Camera app on the Home screen, try searching for it in Spotlight. If the camera does not show up in the search, check to make sure that Restrictions are not turned on by tappingSettings > General > Restrictions.
    Ensure the camera lens is clean and free from any obstructions. Use a microfiber polishing cloth to clean the lens.
    Cases can interfere with the camera and the flash. Try gently cleaning the lens with a clean dry cloth or removing the case if you see image or color-quality issues with photos.
    Try turning iPhone off and then back on.
    Tap to focus the camera on the subject. The image may pulse or briefly go in and out of focus as it adjusts.
    Try to remain steady while focusing:
    Still images: Remain steady while taking the picture. If you move too far in any direction, the camera automatically refocuses to the center.
    Note: If you take a picture with iPhone turned sideways, it is automatically saved in landscape orientation.
    Video: Adjust focus before you begin recording. You can also tap to readjust focus while recording. Exiting the Camera application while recording will stop recording and will save the video to the Camera Roll.
    Note: Video-recording features are not available on original iPhone or iPhone 3G.
    If your iPhone has a front and rear camera, try switching between them to verify if the issue persists on both.
    My issue is still not resolved. What do I do next?
    Contact Apple Support.
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/TS2802
    Cheers,
    Allen

  • HT1338 Macbook Pro, OS X 10.8.1 when start software update receive error msg NSURLErrorDomain error -1100, pls advise what is this error and how to check software update?

    Macbook Pro, OS X 10.8.1 when start software update receive error msg NSURLErrorDomain error -1100, pls advise what is this error and how to check software update?
    Thank you, best regards
    Sergey

    Several users are reporting a server problem with Software Update. Why not wait and try again later today or tomorrow to see if the problem is resolved.
    If the problem is on your computer then give this a try:
    Fix for Software Update
    See Troubleshooting Automatic Software Update in Mac OS X.
    Delete the following files:
    /Library/Preferences/com.apple.SoftwareUpdate.plist
    /Home/Library/Preferences/com.apple.SoftwareUpdate.plist
    /Home/Library/Preferences/ByHost/com.apple.SoftwareUpdate.xxx.plist where "xxx" is a number.
    /Home/Library/Caches/com.apple.SoftwareUpdate/ (delete entire folder)

  • I am trying to review my new apple id and install skype and wats up. i given all credit card details but still its showing error.. pls advise me

    i am trying to review my new apple id and install skype and wats up. i given all credit card details but still its showing error.. pls advise me

    Same here and this is driving me crazy. I can buy, but can't upgrade. Grrr.

  • HT204406 my iTunes match can not pass the step 2, it keeps repeat again and again. Pls advise. Thank you.

    my iTunes Match can not pass the step 2, it keeps repeat again and again. Pls advise. Thank you.

    Very strange.  Two items to try:
    a.  Enable iCloud Status and iCloud Download fields in Song view, sort on status and look for any 'waiting' or 'error';
    b.  If (a) looks good, establish a new user account, create an empty library and enable iTunes Match, confirm that this provides access to all Songs and is working well.
    These are seeking to ensure both no bad Songs or local Library corruption - both are relatively quick.

Maybe you are looking for

  • How to display  menu at runtime?

    Hi People, Can u help me in knowing the use of menu concept.I have tried creating a menu.the menu is also created but only i can compile it.i couldnt run that menu form.what should i do for running menu form?.pls suggest me. Thanks & Regards VIDS

  • Red Arrows not showing in debug mode

    Hi Experts, I have a few processes running in my scenario dropping messages on a queue. For some reason only the main trigger shows red arrows and the rest does not ? Does someone have an idea how I can solve this because I need to debug those parts

  • Adding a Custom VSA to a Group - ACS Appliance

    Hi, Using a secure ACS Appliance 4.0 I want to add a new RADIUS Vendor and its associated VSA to the ACS configuration. This will then be returned during Authorization. I have already added the new Vendor and the required VSA through RDBMS. I can now

  • Breaking up big table cells

    When I have a table and one cell is so full of text that it becomes sizeable the cell stays intact and so starts only on the next page. This leaves an unecessary blank spot at the end of the previous page. How do I set it up so that the big cells can

  • Wireless lan

    I installed windows 7 32 bit on Imac 21.5 and all the apple drivers.The modem is on a PC with a tp-link router, and the iMac connectsby wireless.The connection was working but stopped after a reboot.It only shows the connections of the neighbors. I'v