Change the select query column

I have a query:

Select * from)
Select the COUNTRY, FISCAL_QTR, NET_REV
of OCM_TRANSACTION
)
Pivot
(
Sum (NET_REV)
for FISCAL_QTR in ("2009Q 4' as '2009Q 4', '2010Q 1' as '2010Q 1')
)
order by COUNTRY

It displays the COUNTRY, 2009Q 1, Q 2009, 2 in the PivotTable.
Now I LOV list, if you choose to GEM, the query is able to change

Select * from)
Select GEM, FISCAL_QTR, NET_REV
of OCM_TRANSACTION
)
Pivot
(
Sum (NET_REV)
for FISCAL_QTR in ("2009Q 4' as '2009Q 4', '2010Q 1' as '2010Q 1')
)
order by GEM

Can someone help me on this?
Thank you

No problem, did you work?

Tags: Database

Similar Questions

  • Change the SELECT query

    step-1 select * from t1 --has one column c1 number
    step-2 select * from t2 --has two columns c1 number, c2 number (FK of t1.c1), c3 number (FK of t3.c1)
    step-3 select * from t3 --has two columns c1 number, c2 varchar2
    
    step-4 SELECT t1.*,t2.*,t3.*,
                  ROW_NUMBER() OVER ( ORDER BY t3.c2 ASC
                                            ) RowNumber
              FROM t1
                    LEFT JOIN t2 ON t2.c2=t1.c1
                    LEFT JOIN t3 ON t3.c1 = t2.c3
    step-1
    c1
    ---
    101
    102
    103
    104
    105
    
    step-2
    c1     c2     c3
    ---------------
    1     101     1
    2     102     2
    3     103     0
    
    step-3
    c1     c2
    --------
    0     c
    1     b
    2     a
    
    step-4
    c1     c1     c2     c3     c1     c2     RowNumber
    ---------------------------------------------
    104     NULL     NULL     NULL     NULL     NULL     1
    105     NULL     NULL     NULL     NULL     NULL     2
    102     2     102     2     2     a     3
    101     1     101     1     1     b     4
    103     3     103     0     0     c     5
    
    
    --In above step-4 you will notice that column c2(near RowNumber column) has NULL value. This is because that the record is present in t1 table but it is missing in detail(t2) table. Here I am trying to sort the records on c2 column of t3 table, which is of varchar type. I want to set the default value of column c2 (near RowNumber column) to 'c' and then perform the sorting.
    
    --the expected output is:
    
    c1     c1     c2     c3     c1     c2     RowNumber
    ---------------------------------------------
    102     2     102     2     2     a     1
    101     1     101     1     1     b     2
    103     3     103     0     0     c     3
    104     NULL     NULL     NULL     NULL     c<--     4
    105     NULL     NULL     NULL     NULL     c<--     5
    
    --notice the last two row having '<--'
    
    --how can i achieve this by modifying above step-4 query?

    This?

    SELECT t1.*,t2.*,last_value (t3.c2 ignore nulls) over (order by t3.c2) ,
                  ROW_NUMBER() OVER ( ORDER BY t3.c2 ASC
                                            ) RowNumber
              FROM t1
                    LEFT JOIN t2 ON t2.c2=t1.c1
                    LEFT JOIN t3 ON t3.c1 = t2.c3
    ;
    
  • Programmatically change the selected cell/line of control multi-column listbox

    I want to programmatically change the selected cell of a multicolumn list box whose selection Mode is set to highlight the whole line.  I would use this to highlight the line whatever the list box, I chose to.  It would work the same way if the user has clicked on a line to select and highlight that particular line.  Set Active cell does not fulfill this.

    Steve

    Try to use the property value; p

  • Manager disc Snap-in for the MMC. Is it possible to change the order of columns. Or remove columns completely?

    Manager disc Snap-in for the MMC. Is it possible to change the order of columns.  Or remove columns completely?

    I would like to move the capacity;  Space free; Status; to be fair, Volume.  The page layout;  Type; File system; seems to me

    useless in this form.  If there is no way to change maybe someone at Microsoft may include this option in Windows 9.

    Hello

    I would like to inform that you can not change the order of columns or remove columns completely as it is by design. However, you can display or hide items in the console window.

    Hide columns in Diskmanagement:

    a. Click Start, type diskmgmt.msc and press to enter.

    b. click view and select Customize.

    c. you can select or clear the check boxes to show or hide items in the console window.

    I hope that helps!

  • When you perform queries Smart View Ad hoc, changing the selection of the Alias in the Essbase himself Ribbon

    Hyperion Planning

    GPE, Fusion edition, 11.1.2.2

    Smart View 11.1.2.2

    When running Smart View Ad-hoc queries, selection of the Alias in the Essbase Ribbon does not.

    When I start a new query, the Alias in the Ribbon of Smart View is always set to None; but often, not always, the selection will change itself no default - usually after I refreshred/zoom a few times.  He starts a time past, I change the selection of the Alias in the Ribbon in none, but it changes just itself by default again.

    The option to display the name of the Member is defined on behalf of members only.  (This is the default setting for this option and I usually begin with all the options, by default).

    This problem started after that we went to 11.1.2.2.

    If neither know why the Alias / None change automatically in the Essbase Ribbon?

    Thank you

    Veronica

    There is a way that you can set for your connection

    When you use shared connections to connect to your application, you do a right click and say "Add to private connections". Once you have added to your private connection, right click and click 'Set Alias Table'. You can do this on a connection that you have added to private connections

    Concerning

    Amarnath

  • How to dynamically change the generated query through the "query by example".

    Hi all. I'm relatively new to the ADF, so I've been beating my head against a wall trying to figure out how to do this... Any help would be greatly appreciated!

    What I try to do is to make a custom search (query) against a set of tables in the database. Normally, I would use just the ability to "filter" the af: table to do this (query by example). However, the query I need to run has three specific requirements:

    1. I need to change the 'WHERE' clause differently according to the field in which the user enters criteria in. For example:
    -If the user enters something in the field 'name' of filter, the default ADF BC will do is add '%' to the value entered, turning it into a query "begins by". I also want to prepend a '%' to the input value, (for example "doe %'), it becomes a query 'contains '. I don't want the user to see the '%', I put at the beginning of the field in the UI, however.
    -If the user enters a value of 9 digits in the field 'SSN', do a query of "accurate". If they penetrate only 4 digits, do a query "ends by". (I could always just a query "ends by" - for example "% of values" - even if they have put in 9 digits, and that would work.) However, an exact match will run faster because of the index on the field, so I want to use that if we put 9-digit.)

    2. I also need to change the SELECT part of the query based on which fields are used in the filter.

    3. If the user enters the filter values in several fields, I need 'OR' them together. The default functionality, it's that they are 'linked' together.

    Can someone point me in the right direction? My thought was somehow replace the manner in which the query is generated when the user presses ENTER to run the filter. But, I can't seem to understand where and how to connect it to this process to customize the SELECTION and WHERE the parts of the generated query. I'm sure that there is a way, and I hope more experienced ADF'ers can direct me to the solution.

    Thank you!

    Published by: 926392 on June 25, 2012 15:39

    Published by: 926392 on June 25, 2012 15:40

    Check this post in the ADF Code corner for the necessary information:
    http://www.Oracle.com/technetwork/developer-tools/ADF/learnmore/30-table-filter-queries-169172.PDF

    Thank you
    Nini

  • The select query-based search page...

    I want to create a basic search page at the base on a select query.

    The select query will not be based on Table.Its based on functions.

    I created a view like this object

    Select xx_test_accruals(:p_date) of ACCUMULATION: p_date double DT

    I created a search page

    In the area of provision of Home Page, I added a region of the query. In this region of request I created a result based research Table.

    When I run the page opens with the field

    DT

    When I get back the date and click go, I get the error message like this...

    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: 27122 Houston: SQL error in the preparation of the statement. Statement: SELECT * FROM (select xx_test_accruals(:p_date) of ACCUMULATION: p_date double DT) QRSLT WHERE ((UPPER (DT) like: 1 AND (DT as: 2 OR DT as: 3 OR DT as: 4 OR DT as: 5)))



    Help, please

    Published by: [email protected] on October 4, 2009 14:04

    Hello

    I tried it on my machine... There is a little change on the approach.

    See we have a display object: XxAccrualsSummaryVO

    the query is

    Select xx_test_accruals (to_date (: 1, 'YYYY-MM-DD')) DT ACCRUAL, double to_date(:2,'YYYY-MM-DD')

    Create a view property object: say DateTestPVO and create a transitional DATE type attribute say dated. MinValue. How to create the View Object(read in dev guide) property.

    Link the date to DateTestPVO text entry and the date attribute. MinValue.

    Now that the page will load in process request initialize the PVO not XxAccrualsSummaryVO.

    Public Sub initialisePVO()
    {

    OAViewObject vo = (OAViewObject) getDatePVO1 ();
    If (! vo.isPreparedForExecution ())
    {
    vo.setMaxFetchSize (0);
    }
    Line = vo.createRow ();
    vo.insertRow (row);
    row.setNewRowState (Row.STATUS_INITIALIZED);

    }

    And when you press the Go button and then enter the date entered and set the location where the XxAccrualsSummaryVO clause.

    If (PageContext.GetParameter ("Go")! = null)
    {
    Get the value entered by the user in the date field.

    DateField OAMessageDateFieldBean = (OAMessageDateFieldBean) webBean.findIndexedChildRecursive ("text");
    String datetest = (String) dateField.getValue (pageContext) m:System.NET.SocketAddress.ToString ();
    Now set the where clause VO settings.
    OAViewObject vodate = (OAViewObject) am.findViewObject ("invoicetestVO1");
    vodate.setWhereClauseParams (null);
    vodate.setWhereClauseParam(0,datetest);
    vodate.setWhereClauseParam(1,datetest);
    vodate.executeQuery ();
    }

    It works perfectly... I tested it.

    Thank you
    Gerard

  • How to optimize the select query executed in a cursor for loop?

    Hi friends,

    I run the code below and clocked at the same time for each line of code using DBMS_PROFILER.
    CREATE OR REPLACE PROCEDURE TEST
    AS
       p_file_id              NUMBER                                   := 151;
       v_shipper_ind          ah_item.shipper_ind%TYPE;
       v_sales_reserve_ind    ah_item.special_sales_reserve_ind%TYPE;
       v_location_indicator   ah_item.exe_location_ind%TYPE;
    
       CURSOR activity_c
       IS
          SELECT *
            FROM ah_activity_internal
           WHERE status_id = 30
             AND file_id = p_file_id;
    BEGIN
       DBMS_PROFILER.start_profiler ('TEST');
    
       FOR rec IN activity_c
       LOOP
          SELECT DISTINCT shipper_ind, special_sales_reserve_ind, exe_location_ind
                     INTO v_shipper_ind, v_sales_reserve_ind, v_location_indicator
                     FROM ah_item --464000 rows in this table
                    WHERE item_id_edw IN (
                             SELECT item_id_edw
                               FROM ah_item_xref --700000 rows in this table
                              WHERE item_code_cust = rec.item_code_cust
                                AND facility_num IN (
                                       SELECT facility_code
                                         FROM ah_chain_div_facility --17 rows in this table
                                        WHERE chain_id = ah_internal_data_pkg.get_chain_id (p_file_id)
                                          AND div_id = (SELECT div_id
                                                          FROM ah_div --8 rows in this table 
                                                         WHERE division = rec.division)));
       END LOOP;
    
       DBMS_PROFILER.stop_profiler;
    EXCEPTION
       WHEN NO_DATA_FOUND
       THEN
          NULL;
       WHEN TOO_MANY_ROWS
       THEN
          NULL;
    END TEST;
    The SELECT inside the LOOP FOR cursor query took 773 seconds.
    I tried to use COLLECT in BULK instead of a cursor for loop, but it did not help.
    When I took the select query separately and executed with a value of the sample, and then he gave the results in a Flash of a second.

    All tables have primary key index.
    Any ideas what can be done to make this code more efficient?

    Thank you
    Raj.
    DECLARE
      v_chain_id ah_chain_div_facility.chain_id%TYPE := ah_internal_data_pkg.get_chain_id (p_file_id);
    
      CURSOR cur_loop IS
      SELECT * -- better off explicitly specifying columns
      FROM ah_activity_internal aai,
      (SELECT DISTINCT aix.item_code_cust, ad.division, ai.shipper_ind, ai.special_sales_reserve_ind, ai.exe_location_ind
         INTO v_shipper_ind, v_sales_reserve_ind, v_location_indicator
         FROM ah_item ai, ah_item_xref aix, ah_chain_div_facility acdf, ah_div ad
        WHERE ai.item_id_edw = aix.item_id_edw
          AND aix.facility_num = acdf.facility_code
          AND acdf.chain_id = v_chain_id
          AND acdf.div_id = ad.div_id) d
      WHERE aai.status_id = 30
        AND aai.file_id = p_file_id
        AND d.item_code_cust = aai.item_code_cust
        AND d.division = aai.division;         
    
    BEGIN
      FOR rec IN cur_loop LOOP
        ... DO your stuff ...
      END LOOP;
    END;  
    

    Published by: Dave hemming on December 4, 2008 09:17

  • How to change the rows and columns of newtabs?

    I can't change the rows and columns to mozilla version 33

    From topic: config browser.newtabpage.columns shows 5 by default, but these 5 columns appear not only 3 as before. Don't know why, but I use generally not even the default new tab page in my profile daily.

    Still works this - https://addons.mozilla.org/en-US/firefox/addon/new-tab-tools/ - extension to change the page of newTab via a user accessible interface name in the Addons, rather than routing autour Manager inside Firefox. I use this add-on in a second profile that I use for my favorite sites

  • Display the icon change the number of columns

    I'm sure it must be a way to change the number of columns in the display icon, not the space between columns, not the size of the icons, but the number of columns, for example, that dumpster has 4 columns and I want to see those hidden on the right I have to use the scroll bar, I want to do I want to see ONLY for columns of the filling finder window?

    Thank you very much

    Roger

    "BTW that seems to only happen when I consult with ANY ' arrange by" or "sort by"!

  • How to dynamically change the selection mode of the listbox control?

    Hello everyone

    Is it possible to change the selection mode of the ListBox dynamically?

    Both cases to the attached vi works the same way. I want the listbox to change the mode of selection by 1 point when the channel selected in the drop-down list box is SET.

    Can anyone help please?

    Thank you

    Simo

    There is a property for Listboxes node called selection Mode.

    Do not use the control Terminal in one case and a local variable of it in the other.  Moving the Terminal outside the structure of matter and son in the structure of the case.

  • When I try to change the interactive report columns, then triggers the error: "unable to change column attributes. "ORA-01403: no data found. Pls tell me why?

    When I try to change the interactive report columns, then triggers the error: "unable to change column attributes. "ORA-01403: no data found. Pls tell me why?

    You use listener EA3 ADR?

  • How to dynamically change the names of columns LOV

    Hello

    I use JDeveloper 11.1.1.4

    I have only one requirement, while I need to change the names of columns in the list of values dynamically.

    How can I achieve it.

    Please help me.

    Kind regards

    John.

    Hello

    > But I want to change the column names 'ID' and 'Name' dynamically.

    Based on what? Condition? If Yes, have you tried to set the text for the label as an expression? If not based on the condition, you can also expose the VO to Java Impl and need a way to get the attribute and change its label.

    Arun-

  • Bridge continues to change the selection of the sort each time that I reopen it the Bridge window... WHY?

    Bridge continues to change the selection of the sort each time that I reopen it the Bridge window... WHY?

    I continue to get "sort by modified date" but each whenever I open it a window that it is for manual selection.

    I searched the preferences but impossible to find something to help.  It didn't used to do this...

    John

    Well, I solved the puzzle myself.

    I noticed that somehow a stray .psd file was stuck in my side bar of the Mac Finder.  Don't ask me how it got there.

    At the beginning I couldn't delete it – until I tried a Mac forum and they suggested I hold down the command key and drag it off... to poof!

    It worked.

    And when I went back to bridge - now the bad behavior disappeared!  And when I close the window Bridge and reopen - the choice to "classify" same home!

    Yay... it's a small step for me, and one small step for computerkind.

  • Script to change the selected layer to one of the drop-down list in the layers palette colors

    Hello!

    I was wondering if anyone knows of a script that would allow me to change the selected layers (single or multiple selection) in 'Light Blue' or all the colors in the menu drop-down? (see attached screenshot)

    I found the following but it changes all layers and is the RGB color.

    -----

    say application "Adobe Illustrator"

    set current_Layer in current document

    view the dialog box "in the current document there is" & layersCounter & "layers." & "Recolor label layers?"

    Repeat until (layersCounter = 0)

    set color of layer layersCounter in the current document to {Light Blue}

    set layersCounter to layersCounter - 1

    end Repeat

    end say

    -----

    Screen Shot 2015-06-12 at 10.46.46 AM.png

    I don't know how the script so any help is greatly appreciated. Thank you in advance!

    John

    as far as I can tell this is only possible with a few other modifications... Since 'selected' is not a property of "layers" javascript cannot determine if you see a highlighted layer in the layers panel.

    you could do one of 2 ways. Depending on how many layers you want to change the color, you can either make those visible or hidden (for example, if you want to change to 80% of the layers of a specific color, hide others 20%). and then simply add a clause inside the loop if for.

    var doc = app.activeDocument;

    var layers = doc.layers;

    Blue of var = new RGBColor();

    Blue.Red = 79;

    Blue.Green = 128;

    Blue.Blue = 255;

    for (i = 0; i<>

    If (layers [i] .visible == true) {}

    var = aLay layers [i];

    aLay.color = blue;

    }

    }

Maybe you are looking for

  • iMac will not restart or turn off

    Hello! After the update I can't turn off and restart the menu. All programs are completed, we can only dock bar and nothing more. It turns off only by long press on a button or via the terminal I tried to reset the SMS - closed and removed from the p

  • Aspire One netbook Windows 7

    When I turned on my netbook today, I got a black screen and "Missing operating system" in the upper left corner. I used recently to prepare for a trip and the battery is not dead. The power light is on and nothing happens when I press it. When I plug

  • Problem connecting Dlink - the connection with this computer still only shows "Local".

    My Dlink wifi can connect to all of my other computers, with the exception of a laptop Fujitsu running Vista. Only the connection to this computer always shows "Local". Dlink and Fujitsu point to another, and Microsoft has no viable solution. Help!

  • where can I find name SMTP of my computer?

    I'm trying to set up a new email and it had this information, HELP?

  • Vista boots with a black screen after login

    I can ctrl > alt > del to bring up the TaskMan window only, then on the file Menu, new task and run the Explorer, this action puts the desktop and the taskbar on the screen. The Explorer at the time runs as a file owner verses a system file in the ms