change apxrtins.sql to apexins.sql

Dear,

I install apex.5.0.1 but I forget and run the apxrtins.sql script in a first time, and now I want to run script apexins.sql

When I try to run @ sysaux sysaux apexins.sql is temp

Tell me error: this version of Application Express is already installed (APEX_050000).

How can I solve this problem without using a script of apxremov.sql?

Kind regards

Ahmed

Hello

I'm using apxdvins.sql to converts a to a complete development environment runtime environment.

Thank you very much

Oracle Application Express (APEX) installation, update and use with DPLS and EPG: APEX Install & Upgrade

Tags: Database

Similar Questions

  • Change the SQL report to Intractive report

    Dear friend


    I created the SQL report.

    Could you tell me please, there is a way to change the SQL report to Intractive report.

    How can I do that.

    Thank you

    Under the Definition of the region of the report; look over to the right margin and you will see interactive report-migrate under tasks .

    The f

  • Changing the SQL source region according to requirement

    I have a region of reports that shows the results of some SQL codes. According to the value of a variable to the page I need to run a little different from SQL to get my results. Right now I use 5 different regions and display one suitable and hide others, according to the value of the variable on the page.

    It's a bit messy and I'm looking for a better way to do it. Is it possible to use a single region and change the SQL used as the source of the region after checking my page variable? for example something like this for the source of the region:
    IF :report_type = 1 THEN
    
    SELECT col1, col2, col3 from table1;
    
    ELSEIF :report_type = 2 THEN
    
    SELECT col1, col2, col3 from table2;
    
    ELSEIF :report_type = 2 THEN
    
    SELECT col1, col2, col3 from table3;
    
    END IF;
    .. or something similar?

    Or is there an even easier way to do it?

    Hello

    for "normal" (non-interactive reports), you can provide a block plsql returning a sql query
    as the source of report...

    declare
    v_sql varchar2 (4000);
    Start
    IF: report_type = 1 THEN
    v_sql: = "SELECT col1, col2, col3 from table1";
    ELSE IF: report_type = 2 THEN
    v_sql: = "SELECT col1, col2, col3 from table2";
    ELSE IF: report_type = 2 THEN
    v_sql: = "SELECT col1, col2, col3 from table3";
    END IF;
    Return v_sql;
    end;

    as said - this does not work with interactive reports...

    Best regards

    Carsten-

  • change the SQL license without reinstalling the product?

    We are running out of SQL Server 2005 Workgroup Edition with merge replication, and we just hit a limit of product that we ignore to 25 subscriptions.
    Question: Can we change the Standard Ed license or remove this restriction somehow without having to re - install the product?

    Hello.

     
    Your question of Windows 7 is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT audience Pro on MSDN. Please post your question in the MSDN forum.
     
  • Monitoring stops working after changing the SQL Service account

    I have the Foglight for SQL Server cartridge. I recently changed the service account that is running the SQL Server engine and SQL Server Agent from a local account to a domain account. Everything works fine on the SQL Server side.

    No configuration changes have been made on the Foglight end, and none should be necessary Foglight is configured to use a separate service for SQL account both OS level followed. This account has always been in the local "Administrators" Group on the database server, as well as a "sysadmin" on the side of SQL Server server role. If I 'validate connectivity' within Foglight to that server, it shows that the connection is correct. I tried to remove the monitoring officer and recreation, but yet to see errors in the attached screenshot. Has anyone meet a similar problem?

    Although I couldn't find any indication that the agents were locked, I tried to release them anyway. That seemed to do the trick!

    This can be found here:

    Databases-> Dashboard Support-> Support of databases-> release agents

  • Change TMS SQL use Port

    Hello

    We use the TMS version 14.6

    I have change the default ports used by SQL server (TCP 1433-> TCP 3341 destination ports)

    Please find sheet or give advice

    Thank you

    If you run the application tools of TMS (C:\Program Files (x86)\TANDBERG\TMS\TMSTools\TMSTools.exe) and go to the Configuration tab, which allows you to change the detault Port 1433.)

    Wayne
    --
    Remember the frequency responses and mark your question as answered as appropriate.

  • How to add data to the table changed in sql developer at Apex and vice versa

    Hello

    I had tables of database with sql developer. But now, I have modified the database (new tables added + changed the data in the tables). However, in the Apex, I the old database. Is it possible to get the new Apex database with the data of the table changed so this database in both places (sql and apex developer) is exactly the same... Also the other way around.

    Thank you

    The database schema that contains the tables, is it associated with the workspace even you are searching through the APEX product t development?  Why I'm asking is, if they are the same schema, the tables that you MODIFIED should be appear in the sql for APEX workshop part.  Now reports and forms will NOT see the changes (unless you have actually added or updated definitions for column).

    Can you explain what exactly you were doing the SQL Developer to the tables in your schema?

    Thank you

    Tony Miller
    Los Alamos, NM

  • Changing table - SQL error: ORA-04091: table XYZ is changing, function of triggering/can not see

    Hi all

    I am a newbie to Oracle and I am faced with the above error. Please see the below code snippets. Can someone please tell what I am doing wrong? Thank you in advance.

    Thank you

    CREATE TABLE ABC

    (

    ID VARCHAR2 ENABLE NUMBER NOT NULL,

    FIELD1 ACTIVATE THE NUMBER NOT NULL,

    FIELD2 ACTIVATE THE VARCHAR2 (8 BYTE) NOT NULL,

    CONSTRAINT JOB_PK PRIMARY KEY (ID)

    )

    ;

    CREATE TABLE XYZ

    (

    ACTIVATE THE NUMBER 4 R_ID NOT NULL,.

    ID VARCHAR2 ENABLE NUMBER NOT NULL,

    Column1 NUMBER (2.0) default 0.00,.

    Column2 NUMBER (2.0) default 0.00,.

    COLUMN3 NUMBER (2.0).

    NUMBER (2.0) TOTAL 0.00 default.

    CONSTRAINT TRIP_PAYMENT_PK PRIMARY KEY (ID)

    )

    ;

    create or replace trigger trigger1

    After Insert on XYZ

    for each line

    Declare

    number of newTotal;

    Start

    newTOTAL: =: new. Column1 +: new. Column2 +: new. COLUMN3;

    setting a day of XYZ together Total = newTotal;

    end;

    Insert into ABC (1, 45, ' Demo');

    insertion in XYZ (1, 1, 12.50, 10.20 33,50, ");

    Error report:

    SQL error: ORA-04091: table XYZ is changing, function of triggering/can not see

    Try one before line

    create or replace trigger trigger1

    before inserting on XYZ

    for each line

    Start
    : new. TOTAL: =: new. Column1 +: new. Column2 +: new. COLUMN3;
    end;

  • Tuning sql of a product to the seller without changing the sql statement

    Hello

    We have a product of the provider that generates the SQL statement. For a query, we get the answer in 15 seconds. But users are asking if we can bring it back to 5 seconds. Limitation is the query can not be changed. He used about 10 to 12 tables and bit complex query.

    What kind of options could be evaluated if we are to improve the performance of a query (not sure if she could never be reduced to 5 seconds)
    without making any change to the query.

    Database Version: Oracle 10.2.0.4

    Thank you
    Delphine

    Hello

    http://www.Oracle-base.com/articles/10G/AutomaticSQLTuning10g.php

    your software is enterprise or standard?

    Tuning Pack & pack diagnosis are extra cost option with the standard edition.

    & the useful note * automatic SQL Tuning - SQL [271196.1 ID] profiles *.

    http://www.Oracle.com/us/corporate/pricing/technology-price-list-070617.PDF

    Thank you

    Published by: CKPT November 5, 2010 11:12

  • How to stop the case change in SQL developer Editor

    Dear friends,


    When I begin editing in Developer SQL (version 1.6), case or formatting words is changed automatically.
    Y at - it no option to stop the change of the case.

    Thanking in advance
    Sanjeev

    Assuming you're the 2.1.X SQL Developer trying to disarm

    Tools-> preferences-> Code Editor-> completion Insight-> change as you type

  • How can I change where SQL Developer search files?

    I bring scripts to create a database schema. The installation script looks like this
    @run_install_1.sql
    @run_install_2.sql
    @run_install_3.sql
    Some of these scripts themselves called files.

    I was running quite happily in SQL Developer for a few weeks now (well except for [url http://forums.oracle.com/forums/message.jspa?messageID=3616772#3616772] another this bug). However, now I am trying to get my colleagues to run scripts but they fail. The output of the script says
    Unable to open file "@My documents/run_install_1.sql" (or whatever).
    Basically SqlD is pick up their default directory instead on research in the same directory as the file calling.

    Of course, I managed to change this behavior, but for the life of me I don't know how. It doesn't seem to be an obvious preference to put this.

    Cheers, APC

    blog: http://radiofreetooting.blogspot.com

    OK, well I guess it's a bad news good news story. It is important that you set the directory explicitly in SQL Developer. The good news is that the scripts are now both worked. The bad news is that they don't seem to work when you tried before (can concede typo perhaps?) Also that the @ is not such as you wish. So we have an ER to open a session on this.

    I am sure that we all have in the product of the areas that are important and it's one I use a lot, because I'm always rebuilding my test environment, so when my scripts fail, I'm not happy. ;-)

    In the settings of this directory setting, if indeed you run into inconsistencies. Let us know.

    Sue

  • How to change table-> sql?

    I'm running 4.2.1 apex and move an application from one computer to another, since I couldn't find a way to export with all necessary tabels for this, I create sql scripts each.

    Check the results in the workshop-> tabels-> sql Object Explorer I get these results:

    CREATE TABLE  "SAMPLE" 
       (     "ID" NUMBER,
         "NAME" VARCHAR2(255),
         "SAMP_ID" NUMBER NOT NULL ENABLE,
         "SAMP_FRONT_IMAGE" BLOB,
         "SAMP_BACKWARD_IMAGE" BLOB,
          PRIMARY KEY ("ID") ENABLE
       )
    /
    ALTER TABLE  "SAMPLE" ADD CONSTRAINT "SAMPLE_CON" FOREIGN KEY ("SAMPLE_ID")
           REFERENCES  "SAMP" ("ID") ENABLE
    /

    CREATE UNIQUE INDEX  "SYS_IL0000031445C00004$$" ON  "SAMPLE" (
    /

    CREATE UNIQUE INDEX  "SYS_IL0000031445C00005$$" ON  "SAMPLE" (
    /

    CREATE OR REPLACE TRIGGER  "SAMPLE_T1" 
    BEFORE
    insert on "SAMPLE"
    for each row
    begin
    if :NEW.id is null then
      select SAMPLE_SEQ.nextval into :NEW.id from dual;
    end if;
    end;
    /
    ALTER TRIGGER  "SAMPLE_T1" ENABLE
    /

    Notice the line "CREATE a UNIQUE INDEX ' SYS_IL0000031445C00005$ $' ON 'CARD_TYPE'", which not only duplicates but shouldn't be there at all.

    So, how to edit them? Also, can anyone suggest why they are there in the first place, that I take all the code of the original project and it doesn't have these lines?

    Hello

    First of all, if you want the tables on the new computer, then you will need to export the schema database (not only the apex application) on which your application is analyzed. To export the database schema use the utility "expdp" of oracle database. This will create the dumpfile that must be imported on the new computer (or I would say that the data base). A DBA can help you do it if you don't know about it.

    Unique indexes might appear due to BLOB fields in your table. I'm guessing that oracle db creates a unique index for each BLOB and, possibly, fields in a CLOB table. Since your table contains 2 BLOB fields, two unique indexes are appearing. I see too many these type sql indexes in my tables with BLOB fields. We don't need to create them. The Oracle Apex sql gives also to these indices is actually incomplete.

    My suggestion to export the tables is perform a dump of the schema of the application using "expdp' analysis and import it using"impdp"on the new database. It is not only import tables but also triggers, packages, procedures, functions and all other objects in the schema of your db.

    Contributes to hope

    Concerning

    Marie Laure

  • change the SQL of a view or an SP

    I have a query that displays the user id expiration date. I want to run this as a view or a PC so I don't have access to dba_users in each

    Anyone who wants to run this query.

    [code]

    set pagesize 500
    set linesize 200
    Set trimspool on
    format of column "DATE of EXPIRY" a20
    column "STATUS" format a15
    --
    -View the connections which will be completed in 120 days
    --
    Select the username as 'USER NAME', expiry_date as 'DATE EXPIRES. "
    account_status than the 'STATUS' of dba_users
    where expiry_date < sysdate + 120
    and account_status IN ('OPEN', "EXPIRED (GRACE)")
    order account_status, expiry_date, username

    [/ code]

    I'm looking to do something like this select * from expired_sp of dual and prodiuce the following results as my query don't. Can someone point me in the direction of riht on how do to convert this SQL statement...

    USERNAME EXPIRES DA STATUS

    ---------------------- --------- ---------------

    U574616 3 OCTOBER 13 OPEN

    E667910 3 OCTOBER 13 OPEN

    F529847 31 DECEMBER 13 OPEN

    Thanks in advance to all those who respond

    Hello

    The owner of the view (dba_maint in this case) must have privileges on dba_users WITH GRANT OPTION, given like this:

    Grant select on sys.dba_users to dba_maint

    WITH GRANT - very important OPTION

    ;

    This means that dba_maint is allowed to see dba_users and also to give this privilege to others.

    The view (such as xxx) users may not have WITH GRANT OPTION.  Chances are, you do not want to allow xxx give privileges on the view to other users, so when the granting of privileges to xxx, dba_maint would say

    Grant select on DBA_MAINT. USER_ACCOUNTS_VW xxx

    -with grant option-* DO NOT USE * only dba_maint can give privileges on this view

    ;

  • Change the sql filter code trade name

    All,

    one of my filters is a "Term" Advanced sql code "' Code word ' = VALUEOF (NQ_SESSION. CSA_Analysis_Term)
    When I add the filter to the report (add a filter) the user does not understand the code above,
    and I can't seem to find a way to add a name to make it more useful to users.

    anyone tried it with that

    Thank you

    I see your problem...

    When you have used this session variable in filters part you are able to see the session instead of the value variable last rite?

    You have guest of dashboard set to "Term". "' Term Code ' to the dashboard page?
    If so, why by default the session here filters variable part of the report? by default it prompt default dashboard section...

    just say guest is on the code term column in your report

    Published by: Kishore Guggilla, November 29, 2010 23:38

  • How to change the sql to include totals

    Here is the information required for assistance in this area
    CREATE TABLE APPLSYS.FND_USER
    (
      USER_ID                        NUMBER(15),
      USER_NAME                      VARCHAR2(100 BYTE),
      LAST_UPDATE_DATE               DATE,
      LAST_UPDATED_BY                NUMBER(15),
      CREATION_DATE                  DATE,
      CREATED_BY                     NUMBER(15),
      LAST_UPDATE_LOGIN              NUMBER(15),
      ENCRYPTED_FOUNDATION_PASSWORD  VARCHAR2(100 BYTE),
      ENCRYPTED_USER_PASSWORD        VARCHAR2(100 BYTE),
      SESSION_NUMBER                 NUMBER,
      START_DATE                     DATE,
      END_DATE                       DATE,
      DESCRIPTION                    VARCHAR2(240 BYTE),
      LAST_LOGON_DATE                DATE,
      PASSWORD_DATE                  DATE,
      PASSWORD_ACCESSES_LEFT         NUMBER(15),
      PASSWORD_LIFESPAN_ACCESSES     NUMBER(15),
      PASSWORD_LIFESPAN_DAYS         NUMBER(15),
      EMPLOYEE_ID                    NUMBER(15),
      EMAIL_ADDRESS                  VARCHAR2(240 BYTE),
      FAX                            VARCHAR2(80 BYTE),
      CUSTOMER_ID                    NUMBER(15),
      SUPPLIER_ID                    NUMBER(15),
      WEB_PASSWORD                   VARCHAR2(240 BYTE),
      USER_GUID                      RAW(16),
      GCN_CODE_COMBINATION_ID        NUMBER(15),
      PERSON_PARTY_ID                NUMBER
    )
    INSERT orders
    Insert into APPLSYS.FND_USER
       (USER_ID, USER_NAME, LAST_UPDATE_DATE, LAST_UPDATED_BY, CREATION_DATE, CREATED_BY, LAST_UPDATE_LOGIN, ENCRYPTED_FOUNDATION_PASSWORD, ENCRYPTED_USER_PASSWORD, SESSION_NUMBER, START_DATE, DESCRIPTION, PASSWORD_LIFESPAN_DAYS, EMPLOYEE_ID, EMAIL_ADDRESS, PERSON_PARTY_ID)
     Values
       (2248, '[email protected]', TO_DATE('11/02/2009 17:16:40', 'MM/DD/YYYY HH24:MI:SS'), 1234, TO_DATE('11/02/2009 17:16:40', 'MM/DD/YYYY HH24:MI:SS'), 1234, 3349708, 'ZHDF800E989435A83F862A9078E485E76CC82E51B508395BA3B492F48235BA712864AD0586670C82FA25C6597CC6560EF3D8', 'ZHC7A20CCEEC34081812AB931A0EBD4B5205F68AF5C1BA4FDD4A682F487D61B2CF755672F2C46BAF6717D5C578B3858DFC79', 0, TO_DATE('11/02/2009 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Monty Bilchitz', 30, 10262, '[email protected]', 39299);
    Insert into APPLSYS.FND_USER
       (USER_ID, USER_NAME, LAST_UPDATE_DATE, LAST_UPDATED_BY, CREATION_DATE, CREATED_BY, LAST_UPDATE_LOGIN, ENCRYPTED_FOUNDATION_PASSWORD, ENCRYPTED_USER_PASSWORD, SESSION_NUMBER, START_DATE, DESCRIPTION, LAST_LOGON_DATE, PASSWORD_DATE, PASSWORD_LIFESPAN_DAYS, EMPLOYEE_ID, EMAIL_ADDRESS, CUSTOMER_ID, PERSON_PARTY_ID)
     Values
       (2227, '[email protected]', TO_DATE('04/13/2010 12:39:04', 'MM/DD/YYYY HH24:MI:SS'), 2227, TO_DATE('11/02/2009 09:53:38', 'MM/DD/YYYY HH24:MI:SS'), 1295, 2227, 'ZH314A0F96175B5CDB8974DC680D364364C2C05AB28C8CCDF33AE6087FE0EFC2AA8CF2FC802A139AB0F9A6CCD371F500A38E', 'ZHBB417F192253772E4971BF55465F80F1A2794F2D468B4D94D7A16EABD2FE754F9DA64268FD614BC58FDBF7457BC137C901', 252, TO_DATE('11/02/2009 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Juanita Moldehnke', TO_DATE('04/21/2010 07:48:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('04/13/2010 12:39:04', 'MM/DD/YYYY HH24:MI:SS'), 30, 12541, '[email protected]', 81685, 81685);
    Insert into APPLSYS.FND_USER
       (USER_ID, USER_NAME, LAST_UPDATE_DATE, LAST_UPDATED_BY, CREATION_DATE, CREATED_BY, LAST_UPDATE_LOGIN, ENCRYPTED_FOUNDATION_PASSWORD, ENCRYPTED_USER_PASSWORD, SESSION_NUMBER, START_DATE, DESCRIPTION, LAST_LOGON_DATE, PASSWORD_DATE, PASSWORD_LIFESPAN_DAYS, EMPLOYEE_ID, EMAIL_ADDRESS, CUSTOMER_ID, PERSON_PARTY_ID)
     Values
       (2267, '[email protected]', TO_DATE('03/29/2010 11:13:59', 'MM/DD/YYYY HH24:MI:SS'), 2267, TO_DATE('11/24/2009 11:11:23', 'MM/DD/YYYY HH24:MI:SS'), 1295, 2267, 'ZH08DD1A68B37CAE173579A0B536B0B005F015185C3ED3E01C928F0990B602528C11560665E0EDB8EE8A666351A134D2D40C', 'ZHF50C9B4A60ED037DAD731FE2206B59B4F7305CD647BF6793AA859BB1DFFC18DCC823D6CF4DB43A94C5DBF696774FA37C00', 123, TO_DATE('11/24/2009 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Tanya Swanepoel', TO_DATE('04/21/2010 08:33:45', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('03/29/2010 11:13:59', 'MM/DD/YYYY HH24:MI:SS'), 30, 13003, '[email protected]', 92735, 92735);
    Insert into APPLSYS.FND_USER
       (USER_ID, USER_NAME, LAST_UPDATE_DATE, LAST_UPDATED_BY, CREATION_DATE, CREATED_BY, LAST_UPDATE_LOGIN, ENCRYPTED_FOUNDATION_PASSWORD, ENCRYPTED_USER_PASSWORD, SESSION_NUMBER, START_DATE, DESCRIPTION, LAST_LOGON_DATE, PASSWORD_DATE, PASSWORD_LIFESPAN_DAYS, EMPLOYEE_ID, EMAIL_ADDRESS, CUSTOMER_ID, PERSON_PARTY_ID)
     Values
       (2329, '[email protected]', TO_DATE('04/19/2010 14:33:11', 'MM/DD/YYYY HH24:MI:SS'), 2329, TO_DATE('03/02/2010 12:24:59', 'MM/DD/YYYY HH24:MI:SS'), 1295, 2329, 'ZHE12D2BA87DD3A97F7D17BBD5E5520F903D6C6C92B60021E3F065799E5D7DD3E163699B634050247C981BE0F8FDA81A1559', 'ZH1C22DD76D2FC5967ABFDDA4F3A5298CE9F774B061823C2F566E816C9EDB16F19225D62E85D4DB3FD73DC9DBACA2C7D2426', 91, TO_DATE('03/02/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Simangele Mhlongo', TO_DATE('04/21/2010 09:07:54', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('04/07/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 30, 6834, '[email protected]', 16126, 16126);
    Insert into APPLSYS.FND_USER
       (USER_ID, USER_NAME, LAST_UPDATE_DATE, LAST_UPDATED_BY, CREATION_DATE, CREATED_BY, LAST_UPDATE_LOGIN, ENCRYPTED_FOUNDATION_PASSWORD, ENCRYPTED_USER_PASSWORD, SESSION_NUMBER, START_DATE, DESCRIPTION, EMPLOYEE_ID, EMAIL_ADDRESS, PERSON_PARTY_ID)
     Values
       (2330, '[email protected]', TO_DATE('03/02/2010 12:27:42', 'MM/DD/YYYY HH24:MI:SS'), 1295, TO_DATE('03/02/2010 12:27:42', 'MM/DD/YYYY HH24:MI:SS'), 1295, 5737933, 'ZH61262B400C49CA3F72F7D5036FB5F33302093CCEFA1770AEF927F78222E10A615A4DD2B1F4D3AC7009E3A15879C7EADB70', 'ZH7B252AB5D0BA865795AF26CABD5CC6EBEF98458E3A82ECD11887E7EB89C7461BBE9C356753F88D35DF8B6CE7C0EDC062D3', 0, TO_DATE('03/02/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'Sheilagh Lawlor', 3592, '[email protected]', 8475);
    Current SQL, I want too amendments:
    WITH t1 AS
    (SELECT CASE
    WHEN mm = '01'
    THEN tot
    ELSE 0
    END AS jan, CASE
    WHEN mm = '02'
    THEN tot
    ELSE 0
    END AS feb, CASE
    WHEN mm = '03'
    THEN tot
    ELSE 0
    END AS mar, CASE
    WHEN mm = '04'
    THEN tot
    ELSE 0
    END AS apr, CASE
    WHEN mm = '05'
    THEN tot
    ELSE 0
    END AS may, CASE
    WHEN mm = '06'
    THEN tot
    ELSE 0
    END AS jun, CASE
    WHEN mm = '07'
    THEN tot
    ELSE 0
    END AS jul, CASE
    WHEN mm = '08'
    THEN tot
    ELSE 0
    END AS aug, CASE
    WHEN mm = '09'
    THEN tot
    ELSE 0
    END AS sep, CASE
    WHEN mm = '10'
    THEN tot
    ELSE 0
    END AS oct, CASE
    WHEN mm = '11'
    THEN tot
    ELSE 0
    END AS nov, CASE
    WHEN mm = '12'
    THEN tot
    ELSE 0
    END AS DEC,
    mm,
    tot AS total
    FROM (SELECT TO_CHAR (CREATION_DATE, 'MM') mm, COUNT (1) AS tot
    FROM applsys.fnd_user@MAC1PROD_APPLSYS.MACSTEEL.COM
    WHERE creation_date > to_date('01-01-2010','DD-MM-YYYY')
    GROUP BY ROLLUP (TO_CHAR (CREATION_DATE, 'MM'))
    ORDER BY 1) a),
    t2 AS
    (SELECT SUM (jan) jan, SUM (feb) feb, SUM (mar) mar, SUM (apr) apr,
    SUM (may) may, SUM (jun) jun, SUM (jul) jul, SUM (aug) aug,
    SUM (sep) sep, SUM (oct) oct, SUM (nov) nov, SUM (DEC) DEC,
    SUM (CASE when mm IS NULL THEN total ELSE 0 END) AS total
    FROM t1)
    SELECT jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec, total
    FROM t1
    UNION ALL
    SELECT jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec, total
    FROM t2;
    This is the output current to make a selection above:
    JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC,TOTAL
     
    ----,----,----,----,----,----,----,----,----,----,----,----,-----
     
       2,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,    2
     
       0,   0,  18,   0,   0,   0,   0,   0,   0,   0,   0,   0,   18
     
       0,   0,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,    1
     
       0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   21
     
       2,   0,  18,   1,   0,   0,   0,   0,   0,   0,   0,   0,   21
    I would also add a total column as in this example:

    JAN, FEB, MAR, APR, MAY, JUNE, JULY, AUG, SEP, OCT, NOV, DEC, TOTAL

    ------------------------------------,----,----,----,----,----,----,----,----,----,----,----,----,-----

    4, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 6

    0, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4
    TOTAL 4, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 10



    Any help will be much appreciated.
    Thank you

    Like this?

    SELECT
    NVL(TO_CHAR(extract(YEAR FROM creation_date)),'TOTAL') CREATION_YEAR,
    SUM(DECODE(extract (MONTH FROM creation_date),1,1,0)) JAN,
    SUM(DECODE(extract (MONTH FROM creation_date),2,1,0)) FEB,
    SUM(DECODE(extract (MONTH FROM creation_date),3,1,0)) MAR,
    SUM(DECODE(extract (MONTH FROM creation_date),4,1,0)) APR,
    SUM(DECODE(extract (MONTH FROM creation_date),5,1,0)) MAY,
    SUM(DECODE(extract (MONTH FROM creation_date),6,1,0)) JUN,
    SUM(DECODE(extract (MONTH FROM creation_date),7,1,0)) JUL,
    SUM(DECODE(extract (MONTH FROM creation_date),8,1,0)) AUG,
    SUM(DECODE(extract (MONTH FROM creation_date),9,1,0)) SEP,
    SUM(DECODE(extract (MONTH FROM creation_date),10,1,0)) OCT,
    SUM(DECODE(extract (MONTH FROM creation_date),11,1,0)) NOV,
    SUM(DECODE(extract (MONTH FROM creation_date),12,1,0)) DEC,
    SUM(1) total
    FROM applsys.fnd_user@MAC1PROD_APPLSYS.MACSTEEL.COM
    GROUP BY rollup(extract(YEAR FROM creation_date))
    
    CREATION_YEAR                                   JAN        FEB        MAR        APR        MAY        JUN        JUL        AUG        SEP        OCT        NOV        DEC      TOTAL
    ---------------------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
    2009                                              0          0          0          0          0       0     0          0          0          0          3          0          3
    2010                                              0          0          2          0          0       0     0          0          0          0          0          0          2
    TOTAL                                             0          0          2          0          0       0     0          0          0          0          3          0          5
    

    Check on pivot, if you have 11g

    http://www.orafaq.com/wiki/pivot

    SELECT NVL(TO_CHAR(extract(YEAR FROM creation_date)),'TOTAL') Creation_Year,
    NVL(SUM(JAN),0) JAN, NVL(SUM(FEB),0) FEB, NVL(SUM(MAR),0) MAR , NVL(SUM(APR),0) APR,
    NVL(SUM(MAY),0) MAY, NVL(SUM(JUN),0) JUN, NVL(SUM(JUL),0) JUL, NVL(SUM(AUG),0) AUG,
    NVL(SUM(SEP),0) SEP, NVL(SUM(OCT),0) OCT, NVL(SUM(NOV),0) NOV, NVL(SUM(DEC),0) DEC,SUM(1) Total
    FROM
         (SELECT creation_date,extract(MONTH FROM creation_date) cr_mon
         FROM applsys.fnd_user@MAC1PROD_APPLSYS.MACSTEEL.COM)
    pivot (SUM(1)
         FOR cr_mon IN (1 JAN,2 FEB,3 MAR,4 APR,5 MAY,6 JUN,7 JUL,8 AUG,9 SEP,10 OCT,11 NOV,12 DEC)
          )
    GROUP BY
    rollup(extract( YEAR FROM CREATION_date))
    
    CREATION_YEAR                                   JAN        FEB        MAR        APR        MAY        JUN        JUL        AUG        SEP        OCT        NOV        DEC     TOTAL
    ---------------------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
    2009                                              0          0          0          0          0       0     0          0          0          0          3          0          3
    2010                                              0          0          2          0          0       0     0          0          0          0          0          0          2
    TOTAL                                             0          0          2          0          0       0     0          0          0          0          3          0          5
    

    Kind regards
    Prazy

    Published by: Prazy on April 22, 2010 12:38
    Extra Pivot method

Maybe you are looking for