SQL queries for reports help: need to reverse the data in the column in columns [O

Hi all

I'm looking for help in writing SQL, where I need to reverse the data in the columns column.

My data in DB is as below.

VALUE OF NAME OF MONTH
Jan-10 M1 5
Jan-10 M2 8
Jan-10 M3 9
Feb-10 M1 4
Feb-10 M2 6
Feb-10 M3 2
M4 10 Feb 10
M1 10 Mar 21
Mar-10 M2 6

Power required for the declaration will be like:


MONTHS M1 M2 M3 M4
Jan-10 5 8 9
Feb-10 4 6 2 10
21 Mar-10 6

How can I do this using SQL. [ORACLE 10g]?

I can make use of server Oracle BI also.

Please help me on this...

I think this is wrong forum to ask this question. You want to do it in OBIEE or at the DB level. In oBIEE you can do in a table privot view.

Thnaks,
Knani

Tags: Business Intelligence

Similar Questions

  • When using PDF documents for signature, you need to 'send' the document for signature? Alternatively, can I publish the document on my site and just ask visitors to sign without send me to each person, when using PDF documents for signature

    When using PDF documents for signature, you need to 'send' the document for signature? Or can I publish the document on my site and simply ask visitors to sign without send me to each person?

    Hello

    You can use the Widget feature to publish the document on your website. Here is the link for reference:

    https://helpx.Adobe.com/document-cloud/help/create-widgets.html

    -Usman

  • How many people currently work at apple (by country, if possible), I write a business report and need to know the answer, thank you.

    How many people currently work at apple (by country, if possible), I write a business report and need to know the answer, thank you.

    Watch their deposits of the company. This community is to post technical questions.

    We are users like you. We are not Apple. If you wish to contact Apple use the link contact us at the bottom of this page.

  • You will need to reverse the left and right audio channels, because I would like to avoid too cables around the living room and the right sound.

    You will need to reverse the left and right audio channels, because I would like to avoid too cables around the living room and the right sound.

    tried in SOUND > Speakers > CONFIGURE it on by clicking on the right left speaker sound time and vice versa.

    Hey DiegoWO,

    There is not currently an option within the OS to achieve.
    However, your drivers audio pourrait have a built-in effect that allows you to reverse the stereo sound. If you do not see a separate application to manage your sound, you will need to visit the website of the manufacturer of your sound card and install the latest drivers.
  • Reverse the column data

    Hello
    Thanks Solomon Yakobson of helping to reverse the data, I have another question and need help,
    I want to extract data from my column and then reverse these data (my data are many phrases in a column and the number of lines)
    Then enter these converted data (reverse sentences) in the first place (my column)
    now, I can't do it properly, please help me to do and solve my problem, if is possible :/

    I hope that it will help you:

    SQL> create or replace function reverse_s(v_sentence varchar2) return varchar2 is
      2      p_sentence varchar2(4000):=' '||trim(v_sentence);
      3      p_output   varchar2(4000);
      4  begin
      5      while instr(p_sentence,' ')>0 loop
      6          p_output:=p_output||' ' ||substr(p_sentence,instr(p_sentence,' ',-1)+1);
      7          p_sentence:=substr(p_sentence,1,instr(p_sentence,' ',-1)-1);
      8      end loop;
      9      return ltrim(p_output,' ');
     10  end;
     11  /
    
    Function created.
    
    SQL> create table mytable as
      2  select 'oracle is good enough' mycol from dual union all
      3  select 'column to be reverse' mycol from dual
      4  ;
    
    Table created.
    
    SQL> select * from mytable;
    
    MYCOL
    ---------------------
    oracle is good enough
    column to be reverse
    
    SQL> update mytable set mycol=reverse_s(mycol);
    
    2 rows updated.
    
    SQL> select * from mytable;
    
    MYCOL
    ---------------------
    enough good is oracle
    reverse be to column
    
    SQL>
    

    Nicolas.

  • unnecessary SQL queries for ViewObject used in different tab

    In my application, I have a table A in the first tab and table B in the second tab.

    Sometimes when I work as a user with table B in the second tab, the ViewObjectA for table A is executed.

    Of course this ViewObjectA execution is absolutely useless, because I work in another tab and I don't don't even see table A.

    Unfortunately, the query takes a long time and it makes the application slower.

    Question: why the ADF runs the query for a table that is not visible and the user accesses not?

    Is it possible to prevent it?

    A note on the configuration that may be linked to the problem:

    The ViewObjectA has an implementation customized with debug messages (that's how I discovered the ViewObject is exectuted).

    Due to the limitation of the DB, I have configured my pool ApplicationModule instances of timeout after 120 idle seconds (because the DB does not like the many connections and long-term).

    I also found that after the expiry of the ApplicationModule, a new instance of ViewObjectA is created (Yes, it should according to the ViewObjectImpl API).

    It seems to me that the unnecessary ViewObjectA execution happens after this new creation of instance of ViewObjectA.

    Well, the execution of the query of a VO is part of the creation of a VO.

    You can try to adjust it for example, you add a where clause such as 1 = clause: bindVar' and init the bindVar to 0 so that the query is performed from the user interface (see JDeveloper: obstacle to the return of the games to outline on the loading of the page of VO using the binding variable |) JDev & amp; ADF Goodies).

    Or follow Andrejus Baranovskis Blog: Oracle ADF Tuning: prevent execution of SQL queries during the loading of the Page

    Timo

  • SQL queries for the date and year

    Hi friends,

    I have a named view - item_sales with 4 columns

    Item code

    Name of the element

    Transaction_YYYYMM (Date stored in a format YYYYMM)

    QTY_RECEIVED

    QTY_SOLD

    Sample data is

    ITEM_CODE POINT NAME TRANSACTION_YYYMM QTY_RECD QTY_SOLD

    TSHIRT 201307 3000 2000 AX

    TSHIRT AX 500 2000 201308

    TSHIRT 201309 1000 3000 AX

    CX 201307 3000 2000 XLSHIRT

    XLSHIRT CX 201308 3000 2500

    CX 201309 3000 2500 XLSHIRT

    END OF EACH MONTH I'LL RUN THIS QUERY TO FIND OUT THE DETAILS BELOW

    1. TO FIND NOM_ELEMENT WISE - QTY_RECEIVED AND QTY_SOLD (FOR THE CURRENT MONTH - EXAMPLE SEP)

    2. TO FIND NOM_ELEMENT WISE - QTY_RECEIVED AND QTY_SOLD (EXAMPLE EXERCISE OF JAN TO SEP)

    OUTPUT FOR SEPTEMBER MONTH LOOK LIKE THIS

    SEVEN MONTHS JAN TO SEP

    ITEM_CODE NOM_ELEMENT QTY_RECEIVED QTY_RECEIVED QTY_SOLD QTY_SOLD

    TSHIRT 1000, 3000, 6000, 5500 AX

    CX 3000 2000 9000 7000 XLSHIRT

    Pls advise me how to write queries for this

    RDK

    Hello

    This is called a Pivot, and here's a way to do it:

    WITH got_display_yyyymm AS

    (

    SELECT TO_CHAR (ADD_MONTHS (SYSDATE-1)

    , "YYYYMM.

    ) AS YYYYMM

    OF the double

    )

    SELECT i.item_code

    i.item_name

    SUM (CASE

    WHEN i.transaction_yyyymm = d.yyyymm

    THEN i.qty_received

    END

    ) AS month_received

    SUM (CASE

    WHEN i.transaction_yyyymm = d.yyyymm

    THEN i.qty_sold

    END

    ) AS month_sold

    SUM (CASE

    WHEN SUBSTR (i.transaction_yyyymm, 1, 4)

    = SUBSTR (d.yyyymm, 1, 4)

    THEN i.qty_received

    END

    ) AS year_received

    SUM (CASE

    WHEN SUBSTR (i.transaction_yyyymm, 1, 4)

    = SUBSTR (d.yyyymm, 1, 4)

    THEN i.qty_sold

    END

    ) AS year_sold

    Item_sales I have

    CROSS JOIN got_display_yyyymm d

    I.item_code GROUP, i.item_name

    ORDER BY i.item_code, i.item_name

    ;

    If you would care to post a small example of data (CREATE TABLE and INSERT statements) and the results desired from these data, then I could test it.

    The subquery got_display_yyyymm digit which is the previous month; It is not to change anything from month to month.  If you run the query in October 2013, then YYYYMM Gets the value '201309'.  If you run it in January 2014, then YYYYMM will be '201312'.

    As posted, it will work in Oracle 9.1 or higher.  The SELECT... PIVOT function that was introduced in Oracle 11.1 would not help in this problem, so you do not miss anything using Oracle 10 in this case.

  • Help needed - "cannot download the folio on your local drive.

    Hello

    (WARNING: for the first time post :-))

    I have trouble downloading my folio published. During the last 24 hours I repeatedly get the following error (after a long wait with the status 'Preparation content by downloading... ") on different computers (Mac/PC) and browsers:

    An error occurred during the export of the folio

    Could not download the folio on your local drive

    My first version is delivered to an Android app (created using the viewer Builder) and has been incorporated into an iOS app (also created using View Designer).  All this worked without any problems and I can export this now.

    In order to optimize the folio for the new iPad, I decided to use the PDF option that required me to rebuild the folio.  The content is identical to the bar a few dates changed from 2011 to 2012.  I just need to export the folio so I can incorporate into an update iOS application.  The folio is not (at this stage) given to the Android app.

    I hope someone can help :-)

    Andrew

    Edit: Using the new Adobe Content Viewer I see TWO versions of the folio - one with the lightning bolt blue - but maybe that's normal?

    Hi Philippe,.

    Thanks for the reply.  After a lot of testing, I discovered that my preview of the cover images were the problem.  I've been using PNG files and when I used the versions JPG export worked.

    Maybe that's a one-time problem, but I thought I'd share the solution in any case.

    Kind regards

    Andrew

  • After RMA for camera, I need to transfer the license?

    Hello

    After that I did RMA for faulty camera and got cisco again, do I need to transfer the license agreement license tool?

    Transfer licenses for codecs all the time and there is no problem. but when I try to transfer the license for the cameras I get the following message is displayed:

    "

    [ERR. TA.7] we could not process the request. Please post the serial number provided for recording. The serial number is not recognized by our systems. Please try again. If the problem persists please open a Service request by using the of TAC Service request tool. Please have your valid Cisco.com user id and password available. "As an alternative, you can also call our main technical assistance Center at 800-553 - 2447.Additional Cisco Systems, Inc. of contacts in the world can be found here: http://www.cisco.com/en/US/support/tsd_cisco_worldwide_contacts.html"

    So I thought that maybe it is not necessary to transfer the license if his opening touch camera or remote control?

    Thank you

    Shy

    Shy Hi,

    You are perfectly right for camera ' distance and touch screen you do not need to transfer the license that they have failed to work.

    Each end point who have software or special need to transfer the license.

    Kind regards
    Vivek

    Sent by Cisco Support technique Android app

  • SQL or PL/SQL to display several links of BLOB in the column of the IR

    I have a need in an IR or a standard report to provide a link to view/download several BLOBs. Basically I have a function that, for a given record, will focus on a relational table and get a list of all the associated files and it has a list of output HTML. List the files is great, however, I would like to take a step further and actually have the names of files as a link to view/download the actual file. Reading the API on GET_BLOB_FILE_SRC it doesn't look like it can do what I want, because it requires a valid page for the file element, and I have 0 - x files associated with a row with a given number of lines per page.

    Basically, what I have is...

    Select

    some_pk

    some_data01

    some_data02

    custom_function_get_files (some_pk)

    my table

    order that either;

    It produces something similar to...

    PK Data 1 Data 2 List of files
    1SomethingSomething
    • File01.txt
    • File02.txt
    • File03.txt
    2Datadata
    • Image.PNG
    3xxxxxx(NULL)

    .. and so on.

    Of course, if I did only 1 file I can format the column of type BLOB and APEX type takes care of everything. Any ideas or suggestions?

    I know I could create a list of files as a link to another page, passing the key document and that the 'view' file using this page. Even if it's a little more messy.

    d3bruts1d wrote:

    I have a need in an IR or a standard report to provide a link to view/download several BLOBs. Basically I have a function that, for a given record, will focus on a relational table and get a list of all the associated files and it has a list of output HTML. List the files is great, however, I would like to take a step further and actually have the names of files as a link to view/download the actual file. Reading the API on GET_BLOB_FILE_SRC it doesn't look like it can do what I want, because it requires a valid page for the file element, and I have 0 - x files associated with a row with a given number of lines per page.

    apex_util.get_blob_file_srcis indeed what you are looking for. The parameter item page is simply a shortcut used to get information about the BLOB of metadata associated with items to upload files and ARF process used to load the images. If these elements do not exist because the images are not loaded in this way, simply add the upload queue and ARF process that would be used to do this to a page, the conditions never set on them so that they are not displayed or executed and reference the element in the apex_util.get_blob_file_src call.

    The list of files can be generated in the query using SQL/XML to eliminate the need for a custom function:

    select
        t.some_pk
      , t.some_data01
      , t.some_data02
      , xmlserialize(
            content
            xmlelement(
                "ul"
              , xmlagg(
                    xmlelement(
                        "li"
                      , xmlelement(
                            "a"
                          , xmlattribute(apex_util.get_blob_file_src('P1_FILE', t.some_pk, null, 'attachment') "href")
                          , f.some_filename))
                    order by f.some_filename))) file_list
    from
        my_table t
          left outer join my_files f
            on t.some_pk = f.some_fk
    group by
        t.some_pk
      , t.some_data01
      , t.some_data02
    
  • Universal wheel Racing game for PC help needed

    LM571 universal Racing Wheel made by Hip Interactivwe which is no longer active. I can't get the game running on my PC for the G'kids. I need help I can get.

    Hi ninklink,

    1. who is the edition of Windows that is installed on your computer?
    2. What is the name of the game?

    Not found no information on the device to the Vista Compatibility Center or the Windows 7 Compatibility Center. This means that the unit may or may not be compatible.

    To find out if the device is compatible with your windows, we recommend to contact the supplier of the device for more support options.

    To work around the problem, you can install the device driver in Windows XP Service Pack 2 compatibility mode and check if the device works fine on your computer.
    See make older programs run in this version of Windows

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • A way to recover the toolbar for firefox 10 update norton? I miss secure identity, forced to go back to IE for my research need to access the Norton toolbar. have run live update several times. Firefox ext State is not compatible with firefox10. Help ple

    I have computers w / win 7 home premium, win 7 pro and win 7 ultimate. Norton no longer functions with any of these operating systems and the most recent firefox update.

    10 for Norton Toolbar Firefox support

    Check and tell if its working.

  • Array as parameter of output for procedure - help needed.

    Hello

    I'm having a procedure that calculates 6 medium.

    Now, can I get these 6 values as output parameter using an array.

    Help, please.

    Thanks in advance.

    Concerning
    Rambeau

    Did you not find this thread and be useful?

    Re: Return of the associative arrays in a stored procedure

  • Need help, need to install the SSD Samsung 830 on my HDX16T

    I have a laptop HP Hdx16t Entertainment, and I was wondering if someone can explain what I need, or how to install until I open it myself. Right now all I have is real laptop and the Samsung 830 256 gb SSD. Do I need other cables of? or the disk hard is just snap? It's an easy task? I have never replaced one of front. Any help would be greatly appreciated. Sorry for my noob question.

    Hello:

    It should be pretty easy to do it yourself.

    Here is the link to the service manual for your laptop.

    http://h10032.www1.HP.com/CTG/manual/c01612461.PDF

    See Chapter 4 for R & R procedures.

    You must transfer the material from the original to your new SSD (caddy, connector and screws).

    Paul

  • Help - need to consolidate the partitions on the hard disk after system recovery

    There are 4 partitions on my laptop Lenovo w/Vista. They are the main with the system OS etc. files partition, then an extended 9.7 GB partition labeled volume D: 98 GB of unallocated space and then finally the OEM with the recovery image section. I want to create a partition that is important as the C: volume with all that on it. The only other partition would be the volume of the OEM. Now when I try to use the unallocated space (create a simple volume with quick format) it says the operation cannot be completed because there is not enough space on the hard drive; that cannot be true because the unallocated space is 98 GB +. I got the OS to the factory setting thinking that it would be re - format the hard disk for the installation of 2 original score. No luck. I need help! We cannot add a lot of apps of software in the form of program files before the C: drive runs out of space. Help!

    http://social.answers.Microsoft.com/forums/en-us/vistahardware/thread/95190cc5-B448-4a93-98ed-9a1e5c2354fb

    Answered in the other Forum.

    Mick Murphy - Microsoft partner

Maybe you are looking for

  • IPod touch ios 9 Virus/melware

    An iPod touch running iOS 9.3.2 will get a virus/malware safari? (It is not jailbreak) and the attacker will find here where I live? Thank you for responding!

  • Unexpectedly on my Mac

    10.8.2 retina macbook pro 2.6 ghz intel core i7, 16 GB 1600 MHZ Logs you have requested, attached. It is obvious that you guys created bugs on the way (I'm not the only person to post on this) and yet you make us do all the work, miss scheduled meeti

  • HP DeskJet Ink Advantage 3636: Please confirm if by default the cartridges come in HP DeskJet Ink Advantage 3636 Printer

    Hi team, Please confirm if the cartridges is delivered by default printer HP DeskJet Ink Advantage 3636 as we couldnot find the site of HP India. Here is the link to what is included. http://WWW8.HP.com/in/en/products/printers/product-detail.html?OID

  • Unable to access the VPN Client LAN

    I configured a 877 for VPN Client Access. The Client authenticates and connects and receives an IP address off the coast of the pool of intellectual property. However, he is unable to access anything on the IP network. I have included my router confi

  • BlackBerry 9500 storm Blackberry Smartphones

    Hi all, I recently bought a handset used 9500 touch screen and unlocked for my father, I noticed when I added the list of dads contacts on the phone and tried to sound a U.S. prefix code rises, I can only assume the phone is American. The phone accep