I'm having issues by rotating the following data... help please...

So the following question:

SELECT YEARS_,METRIC_NAME,METRIC_VALUE from (
  (SELECT to_char(ADD_MONTHS(SYSDATE,((-ROWNUM+1)*12)),'YYYY') YEARS_ from DUAL CONNECT BY LEVEL<=5)
  LEFT JOIN CORE_METRICS on YEARS_=CORE_METRICS.METRIC_SUBNAME
  and CORE_METRICS.METRIC_VALUE IS NOT NULL)


SPOKEMETRIC_NAMEMETRIC_VALUE
2013BACKUP_TB_COST100
2014BACKUP_TB_COST200
2013VMAX_TIER1_TB_COST150
2014VMAX_TIER1_TB_COST300

What I would do, it's this array of PivotChart so that the METRIC_NAMES are the columns and values are the METRIC VALUE

and each row in the returned table would be one spoke...

So, something like

YEARS BACKUP_TB_COST VMAX_TIER1_TB_COST
2013100150
2014200300

I want to display. I don't know because I'm on 11g can I somehow turn the table around, or do I have to write a PLSQL procedure to cope with this.

Thank you

Rob

Hello

bostonmacosx wrote:

with pivot_data as (SELECT spoke, METRIC_NAME, METRIC_VALUE of)

(SELECT to_char (ADD_MONTHS (SYSDATE, ((-ROWNUM+1) * 12)), 'YYYY') spoke of DOUBLE CONNECT BY LEVEL)<>

LEFT JOIN CORE_METRICS on spoke = CORE_METRICS. METRIC_SUBNAME

and CORE_METRICS. METRIC_VALUE IS NOT NULL))

SELECT spoke, METRIC_NAME, pivot_data METRIC_VALUE

pivot)

SUM (METRIC_VALUE)

for METRIC_NAME

IN (NETAPP_TB_COST,

MAINFRAME_COST_PER_CPU,

VMAX_TIER1_TB_COST,

VNX5500_TB_COST,

RS6000_COST_PER_CPU,

SERVER_COST_PER_CPU,

BACKUP_TB_COST,

VMAX_TIER2_TB_COST)

);

In the PIVOT clause, use single quotes around names:

pivot)

SUM (METRIC_VALUE)

for METRIC_NAME

IN ('NETAPP_TB_COST',

"MAINFRAME_COST_PER_CPU,"

"VMAX_TIER1_TB_COST,"

...

"NETAPP_TB_COST" (inside the single quotation marks) is a constant string 14

NETAPP_TB_COST (outside the quotes) indicates a column or a function with the same name of 14 characters.  You get an error message on any such column existing if you do not have another error, to use a column name where a constant is expected, first of all.

Of course, I can't test anything, until you post the data.

Tags: Database

Similar Questions

  • Cannot rotate the Photos! Help, please

    I can't turn my photos.   I have most of my photos on external hard drives.  When I try to turn them (per click, open in paint or open them in Windows Photo Viewer) Windows 7 don't rotate.  Instead, I get an error message indicating that "you can not turn this image. The file may be used or open in another program, or the file or the folder may be read-only. "I tried to give my complete access to the user account on the external drive, and I also tried to score the file, the folder and the only readable drive.  He's going through and looks like it is something, but in the end, I always get the error message.  I can turn them if they are on the C: drive, but my C: drive is too small to hold my collection of photos...  Help!

    I just installed Windows 7 Professional 64-bit, and I couldn't turn one of the photos on my internal hard drives. After clicking out of around, I realized what the problem was.

    You must:

    1. click on the start menu.
    2. click on computer.
    3. right click on the drive that gives you trouble.
    4. Select Properties.
    5. click on the Security tab.
    6. click on the Edit button where it says "to change permissions, click on change."
    7. in the "group or user names", click on the user you want to change. On my computer, I had to choose 'Users (computer-name\Users)' at the bottom of the list.
    8. in the area 'Permissions for the users', click the checkbox to allow full control.
    9. click on ok.

    There are boxes popup telling you that it cannot change permissions on some files. Just click ok to continue.

    Repeat these steps on each player that gives you bad.

  • I have an imac 27 "... on power there is no signal to startap, usb ports are not working and its deadlock with the logo of the Apple with the circle of rotation... Help, please

    I have an imac 27 "... on power there is no signal to startap, usb ports are not working and its deadlock with the logo of the Apple with the circle of rotation... Help, please

    Wake the computer to your Apple store or Apple authorized service for the service provider. He probably suffered a hardware failure.

  • "Everything by signing the application I'm JF the following error" rectify please. Something wrong with my application?

    https://developer.BlackBerry.com/HTML5/documentation/signing_your_smartphone_app_1919664_11.html

    "Everything by signing the application I'm JF the following error" rectify please. Something wrong with my application?

    Below you can see the screenshot of it

    Please like mewhere Iam wrong is a valid config.xml file is in the Google folder in

    C:\inetpub\wwwroot\Google

    I followed "package and sign" method on the emulator and committed to my request.

    IAM able to sign the application now.

  • RW-00000: cannot write in the following directory. Please check the permissions. Failed to create the context to the/tmp file

    Hi, I'm under RapidWiz 12.2.0.50 to make a R12.2 installation on a platform for x 86-64 Oracle Linux 7.1.

    I get the error message

    RW-00000: cannot write in the following directory. Please check the permissions. Failed to create the context to /tmp/11061511/lab3_DEMO1_db.xml file

    However I've looked at what my directory/tmp is completely open (wise authorization), as well as the subdirectory 11061511 under

    lab3-nms: / > ls - al

    drwxrwxrwx. 14 root root 4096 Nov 6 15:22 tmp

    lab3-nms: / tmp > ls - al

    Total 16

    drwxrwxrwx. 14 root root 4096 Nov 6 15:22.

    drwxrwxrwx. 19 root root 4096 Nov 6 14:19...

    drwxrwxrwx 2 root root 25 Nov 15:11 6 11061511

    drwxrwxrwx. 2 root root 19 6 Nov 14:18 .esd-0

    drwxrwxrwx. 2 root root 6-9 Oct 23:16 current unix

    drwxrwxrwx. 2 root root 17 6 Nov 15:11 hsperfdata_root

    drwxrwxrwx. 2 root root 14:18 Nov 94 6. ICE-unix

    drwxrwxrwx 2 root root 23 6 Nov 14:18 ssh-KQeDztQLkQHj

    drwxrwxrwx 3 root root 16 6 Nov 14:18 systemd-private-OgJMdJ

    drwxrwxrwx 3 root root 16 6 Nov 14:18 systemd-private-S5pkDq

    drwxrwxrwx 3 root root 16 6 Nov 14:18 systemd-private-x5Iry2

    drwxrwxrwx. 2 root root 6-9 Oct 23:16. Test-unix

    -rwxrwxrwx 1 root root 11 6 Nov 14:18. X 0-lock

    drwxrwxrwx. 2 root root 24 6 Nov 14:18. X 11-unix

    -rwxrwxrwx 1 root root 11 6 Nov 14:18. X 1-lock

    drwxrwxrwx. 2 root root 6-9 Oct 23:16. XIM-unix

    lab3-nms: / tmp/11061511 > ls - al

    Total 16

    drwxrwxrwx 2 root root 25 Nov 15:11 6.

    drwxrwxrwx. 14 root root 4096 Nov 6 15:22...

    -rwxrwxrwx 1 root root 8529 6 Nov 15:22 11061511.log

    any ideas what the permission problem?

    Thank you

    Jim

    Found the problem and it's nothing to do with users, groups, and permissions of files (tmp or anything else besides!)

    The problem was that I had not put the sysconfig according the upgrade installation Notes & R12.2 for Linux x 86-64 ( note 1330701.1 )

    I guess the bum steer, which gives install them quick - is indicating that the question is a problem of permission of the files in / tmp, when it is not really!

    The only thing I can think is that it uses sysconfig content to add the name of host or domain, the file name, he tries to put in / tmp.

    hope this helps

    Jim

  • How to find the dense rank for the following data?

    I would like to know the dense rank of the following data:

    Table1:

    emp_id, emp_name salary

    1 name1 5000

    2 6000 name2

    3 name3 7000

    4 name4 8000

    I would like the classification of employees as below:

    Rank

    Name4 1

    Name3 2

    name2 3

    Name1 4

    Any body justify this request?

    Well, for every dense grade use DENSE_RANK :-) http://docs.Oracle.com/CD/E11882_01/OLAP.112/e23381/olap_functions004.htm

    WITH table1 AS(
    SELECT 1 emp_id, 'name1' emp_name, 5000 salary FROM dual UNION ALL
    SELECT 2 emp_id, 'name2' emp_name, 6000 salary FROM dual UNION ALL
    SELECT 3 emp_id, 'name3' emp_name, 7000 salary FROM dual UNION ALL
    SELECT 4 emp_id, 'name4' emp_name, 8000 salary FROM dual
    )
    SELECT  emp_name
           ,DENSE_RANK() OVER (ORDER BY salary DESC) "Rank"
    FROM    table1;
    

    Concerning

    Marcus

  • I bought Acrobat Pro DC and followed the instructions download, but cannot find the link for the download. Help, please!

    I bought Acrobat Pro DC and followed the instructions download, but cannot find the link for the download. Help, please!

    Have you checked with link below?

    Download Adobe Acrobat products. Standard, Pro | DC, XI, X

  • Logic required for the following data


    Hi all

    I have the procedure that I call a cursor to retrieve records. This query returns the following data

    DISZDIICWTBack to topdown
    9 1/29.6258.92136181602
    13 1/213.37512.51561191962
    18 1/218.62517.75587.520503
    262624.7510520103
    9 1/29.6258.8354016023858
    776.2762616836352

    I want to print only those values...

    9 1/29.6258.92136181602
    9 1/29.6258.8354016023858
    776.2762616836352

    As you can see in these first values and down overlap.

    I tried several ways to sort the query on the fields and have a logic, but I always get an extra line that is not overlapping.

    Can someone give me please the logic to get the desired result through conditions of procedure/function/formula

    Thank you

    929107 wrote:

    Hey Maher,

    Thanks for the reply, but I'm looking at some generic logic /Algorithm, I don't want to play with a fixed set of values. Values can change with the evolution of other structures.

    Kind regards

    I showed with fixed values for explanation.

    You can use my select statement on your table

    Select * from

    (select di, dii, ctw, sz, offset (down) on ldown (top control)

    of )

    where downstairs > = nvl (ldown, down);

    Concerning

    Mr. Mahir Quluzade

  • ORA-20001: APP-FND-02604: one or more of the following data are not valid

    Hello

    I use the fnd_user_pkg.addResp procedure to add the responsibility of self-service to a group of users with the script below:

    Start
    for e in loop (SELECT a domain NAME)
    -dbms_output.put_line (e.name); just to confirm the names are there
    fnd_user_pkg.addResp (e.name, 'BY', 'CBK_EMPLOYEE_DIRECT_ACCESS', 'STANDARD', 'CBK Employee Self Service', sysdate, null);
    end loop;
    end;
    */*


    eld table contains the names of users to add, in capital letters. When I try to run the script, it fails with the error:

    ERROR on line 1:
    ORA-20001: APP-FND-02604: one or more of the following data are not valid:
    APPLICATION_SHORT_NAME =, RESPONSIBILITY_KEY = CBK_EMPLOYEE_DIRECT_ACCESS,
    SECURITY_GROUP = STANDARD.
    ORA-06512: at the 'APPS '. APP_EXCEPTION", line 72
    ORA-06512: at the 'APPS '. FND_USER_PKG', line 2713
    ORA-06512: at line 4 level


    However when I run the procedure of inserting a single user at a time, it ends without error. A popular thought.

    Dula

    Hello

    User_id = this will come from the fnd_user table?

    Fix.

    responsibility_application_id and responsibility_id = this will be retrieved through a query joining the tables?

    You can find it in the FND_RESPONSIBILITY, FND_RESPONSIBILITY_TL tables... See the site for more details--> http://etrm.oracle.com eTRM

    Thank you
    Hussein

  • I just bought the 14 items and I don't see the download button. only for the operating system of the ILO. Help, please.

    I just bought the 14 items and I don't see the download button. only for the operating system of the ILO. Help, please.

    Make sure that you are logged on the Adobe site, having cookies enabled, clearing your cookie cache.  If he continues to not try to use a different browser.

    Download and Installation Help-

    https://helpx.Adobe.com/download-install.html

    PES 10, 11, 12, 13, 14 - https://helpx.adobe.com/photoshop-elements/kb/photoshop-elements-downloads.html

    PE 10, 11, 12, 13, 14 - https://helpx.adobe.com/premiere-elements/kb/premiere-elements-downloads.html

    You can also download the demo version of the software through the page linked below and then use your current serial number to activate it.

    Don't forget to follow the steps described in the Note: very important Instructions in the section on the pages of this site download and have cookies turned on in your browser, otherwise the download will not work correctly.

    Photoshop/Premiere Elements 14: http://prodesigntools.com/photoshop-elements-14-direct-download-links-premiere.html

  • my wifi stopped working suddenly. It shows no available networks. However, another iphone is able to connect to the router. Help, please

    my wifi stopped working suddenly. It shows no available networks. However, another iphone is able to connect to the router. Help, please

    Hello

    1 have you made changes to your computer recently?

    2 are you able to access the Internet through an Ethernet cable?

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

    Windows wireless and wired network connection problems

    I hope this helps.

  • my screen is upside down. I hit the key STROKE somw and now can go right to the top. Help, please

    my screen is upside down.  I hit a few key Strokes and now cannot get right to the top.  Help, please

    Try holding down CTRL + ALT + one of the arrows to rotate the screen.

  • I downloaded a few applications directly from safari, will jailbreak my iphone? More apps that I downloaded Safari isn't in the settings. Help, please

    I downloaded a few applications directly from safari, will jailbreak my iphone? More apps that I downloaded Safari isn't in the settings. Help, please.

    software can not install any other source then app store on an unjailbroken ios device

  • Hi, I just got a second generation ipod nano, and whenever I have unplug the charger a line crosses the screen. Help, please

    Hi, I just bought a used second generation ipod nano and whenever I have unplug the charger a line crosses the screen and I can't do anything with the ipod. Help, please.

    When you do a Reset (reboot) on the iPod

    Learn how to reset your iPod - Apple Support  (see iPod with a click wheel)

    do you see this line on the screen when the Apple logo?  If you do, it is probably a hardware problem.  If the line is not there at the start, but returns after the iPod starts, you can do a restore of the iPod using iTunes.  This d erases the IPO, reinstall its software and sets it to the default settings.

    Use iTunes on your Mac or PC to restore your iPhone, iPad or iPod settings - Apple Support

    If the problem persists after the restore, the cause is likely to be hardware problem.

  • LG C500-G. AEE5GE1 with Windows 7 home prem OA MEA have been formatted. But despite giving the product key and Windows registry does not recognize the activation. Help, please

    LG C500-G. AEE5GE1 with Windows 7 home prem OA MEA have been formatted. But despite giving the product key and Windows registry does not recognize the activation. Help, please

    Name of the operating system Microsoft Windows 7 Home Premium

    Version 6.1.7601 Service Pack 1 Build 7601

    Manufacturer of operating system Microsoft Corporation

    System name HANDSOME-PC

    System manufacturer LG Electronics

    System model C500.-g. AEE5GE1

    System Type X 86-based PC

    Processor Intel (r) Core i3 CPU M 390 @ 2.67 GHz, 2666 Mhz, 2 Lossnay, 4 logical processors

    H46YSF00 Version/Date of BIOS American Megatrends Inc., July 2, 10

    Product key:

    X 16-96084

    CONCERNING

    TUESDAY BIOJY

    Have you tried to restart by phone?

    How to activate Windows 7 manually (activate by phone)
     
    1) click Start and in the search for box type: slui.exe 4
     
    (2) press the ENTER"" key.
     
    (3) select your "country" in the list.
     
    (4) choose the option "activate phone".
     
    (5) stay on the phone (do not select/press all options) and wait for a person to help you with the activation.
     
    (6) explain your problem clearly to the support person.
     
    http://support.Microsoft.com/kb/950929/en-us

Maybe you are looking for