How to return the value 0 for no data using the County?

Hi all
I used this query to count the number of records for each month of the year:

SELECT DISTINCT COUNT (I.information_sid) COUNT, TO_DATE (TO_CHAR (INSERT_DATE, 'MM'), 'MM') MONTH

INFORMATION I

TO_DATE GROUP (TO_CHAR (INSERT_DATE, 'MM'), 'MM')

ORDER BY TO_DATE (TO_CHAR (INSERT_DATE, 'MM'), 'MM')

But this code returns no value for months without data
I want to return the value '0' for any month of data. How, please?

Note: I use reports 6i.

Maybe this?

SELECT SUM(CNT_REC) CNT_REC, MONTH
FROM
(
SELECT COUNT(I.information_sid) CNT_REC, TO_DATE(TO_CHAR(INSERT_DATE,'MM'),'MM') MONTH
FROM INFORMATIONS I
GROUP BY TO_DATE(TO_CHAR(INSERT_DATE,'MM'),'MM')
UNION ALL
SELECT 0, LPAD(ROWNUM,2,0)
FROM ALL_OBJECTS
WHERE ROWNUM <= 12
)
GROUP BY MONTH
ORDER BY MONTH

No need to SEPARATE during the use of GROUP BY.

-Clément

Tags: Oracle Development

Similar Questions

  • How to return a value empty for a column

    Hi all

    We want to create an abridged version of the BI dashboards report that has the same number and order of the columns, but fewer lines. This will improve the size and performance of the load, Services dashboard.

    For some columns, we need empty values, which means that the content must be empty, but the column must appear in the report.

    I tried a few options in the tab "format of the column" under properties of the column of check and played with 'column header' and 'value', however, I couldn't get the desired effect.

    Can achieve us?

    Please suggest me on the same.

    Regds
    Mano

    If you want to add a column to the State and the column indicates no data except null, you can do this by adding a column to the area in question and change its format to two single quotes without space between them (which basically means the null value).

  • How to return us an invitation for a member of the team?

    We had to build a new computer for a member of the team.

    How to return us an invitation for a member of the team?

    Hi Jim,.

    If the team member already has an active license of the team, do not re - invite.

    Please refer to the help documents below to download the application Adobe CC:

    Creative cloud to desktop

    Download, install, update or uninstall applications

    In the event that the Member did not have an active license, please see the help below document:

    Manage your creative cloud to the membership of the teams

    Kind regards

    Sheena

  • set_item_property changing the text, but how to return the original value

    Hi all
    I use Oracle Forms Builder 10 gr 2 / I have the following problem: in a button I trigger when it is pressed. And then I change a few elements prompt text. But my problem is how to return the original prompt text. A kind of refresh or clear?


    Here is a piece of code that modifies the prompt text:
    set_item_property('XXBG_CE_STATEMENT_LINES_NEW.AGENT_NO', PROMPT_TEXT, get_item_property('XXBG_CE_STATEMENT_LINES_NEW.AGENT_NO', prompt_text) || '*');
    Thanks in advance,
    Bahchevanov.

    This is not tested, but it's something like this:

    declare
       v_item  varchar2(200);
    begin
       v_item := get_block_property('block',first_item);
       loop
          exit when v_item = 'block.'||null;
          set_item_property(...);
          v_item := 'block.'||get_item_property(v_item,nextitem );
       end loop;
    end;
    
  • How to return the approver e-mail notification iProcurement in R12?

    Hi all

    How to return the approver e-mail notification iProcurement in R12?

    Symptom: A Summit a requisition to B, need for approval of B

    (1) B lost the e-mail that is sent by A
    (2) need B a new notification sent by A.

    environment: Oracle R12.1.2 | AIX 6.1




    Concerning
    Terry Chen

    I thank you for your answer, you want to reassign B once again?

    Yes.

    Can I use the feature "Rewind"? Can this function sends notification to the user again?

    Don't know if it would work for notifications of iProcurement, then please try first the option to reassign.

    Thank you
    Hussein

  • How to return two values of a function?

    Hi all
    I have a function which returns a varchar2 value. This value is used in the SQL of a ref cursor

    Now I want this function returns two values. I tried to use varray, but could not accomplish the task.

    Can you tell me how can I find the two values from a function? and how this function can be called in a SQL query?

    Thank you very much

    The query should look like:

    SELECT v.col.name AS name
         , v.col.flag AS flag
    FROM   ( SELECT kk_test_kk(t.somecolumn,t.someothercolumn,42) AS col
             FROM   sometable t ) v;
    

    Note that you need to prefix with the name of view inline ('v' in the example) and the expression of the function ('col' in the example).

  • Columns of folder: by default, how can return the first column 'Name' without having to move it manually every time?

    Something's happened awhile and when I create a folder which appears the first column is the column 'Date modified '. By default, how can return the first column 'Name' without having to move it manually every time?

    Hello

    I suggest you to visit these links and check if it helps:

    http://Windows.Microsoft.com/en-us/Windows-Vista/working-with-files-and-folders#section_4

    http://Windows.Microsoft.com/en-us/Windows-Vista/folders-frequently-asked-questions

    It will be useful.

  • How can I email a card for people who use my SkyDrive?

    How can I email a card for people who use my SkyDrive?

    How can I email a Christmas card to people who use my SkyDrive?

    It has nothing to do with Word, but you either put the Christmas card in the Public folder and send link to this folder for people who want to 'receipt' card, or create a new folder and invite these people to access this folder in which you put the Christmas card.

    Should ask questions about SkyDrive in http://windowslivehelp.com/

  • How to activate my MSF program for I could use more than 30 minutes at a time

    I had to uninstall my Microsoft Flight Simulator X and MSF - program of acceleration of my PC and reinstall them.  I did it.  When I installed FSX-Deluxe edition, the program asked me the activation number, I gave and then reinstalled the acceleration program. He asked for all the numbers, but now when I run the program, it suits me after 30 minutes then and asks for the active program.  I tried to use the Enternet and everything, but I can't well any place where I can activate this program.  I even call your hotline, they were of no help at all.  First I did not understand that you are Tech. He talked so fast and has no sense at all.  My question is: How can I activate the program? without going to halfway around the world to do. I never had this problem in the past, why now?

    Chuck Baumgartner

    Hello

    I suggest you to follow the steps mentioned in the article below and let us know if the problem is solved or not.

    How to activate my MSF program for I could use more than 30 minutes at a time

    http://support.Microsoft.com/kb/925723

    Also check the links below.

    Frequently asked questions on how to enable Microsoft Games for Windows, streets and trips and Mappoint

    http://support.Microsoft.com/kb/927007

    Microsoft Flight Simulator X Service Pack 2 Readme

    http://www.Microsoft.com/products/games/FSInsider/downloads/pages/SP2-en-Readme.aspx

  • How to return the value of messageLovChoice

    Hello
    I used messageLovChoice to implement of poplist and return value to other elements as lov. I'm not Toolbox example to create extenal Lov, I just use internal lov located in messageLovChoice.
    But if I do not run the VO that messageLovChoice used, the poplist show more... But I can search results lov table items, and other parameters can be set by lov selected/fast selected value.
    Poplist do have values, I for the poplist VO executequery. then when the page show first of all, there are values in poplist, but even choose poplist value, no value is derived and set other items.

    Could someone can help to lookinto it? From my understanding, messageLovChoice should be messageChoice and messageLovinput function, so the values should be returned to other elements through lov card when click poplist value, is it good?

    Best regards
    Eileen

    Hello

    According to my understanding, it uses LOV just to show the values (if the values are more than 30), what features are it of just a poplist not a LOV

    Kind regards
    Out Sharma

  • How to return the lines after a selected line

    Hi there, I need return the straight after that the condition I have is filled...

    given the following table:

    date col ID
    123 Y 29/02/2013
    123 X 27/02/2013
    * 123 Y 26/02/2013 *.
    123 Z 26/02/2013
    * 123 X 25/02/2013 *.
    123 Z 25/02/2013

    I need a query that retrieves all rows that come immediately after col = 'Z' it is
    123 X 25/02/2013
    123 Y 26/02/2013

    Any help would be appreciated,

    Hello

    Martel wrote:
    Hi there, I need return the straight after that the condition I have is filled...

    given the following table:

    date col ID
    123 Y 29/02/2013
    123 X 27/02/2013
    * 123 Y 26/02/2013 *.
    123 Z 26/02/2013

    The 2 highest ranks (and the 2 lines below, by the way) seem to have the same date. I guess there is something that you are not showing that puts unqmbiguously in the order listed.

    * 123 X 25/02/2013 *.
    123 Z 25/02/2013

    I need a query that retrieves all rows that come immediately after col = 'Z' it is
    123 X 25/02/2013
    123 Y 26/02/2013

    It's just that the analytic LAG function.

    Any help would be appreciated,

    Here's one way:

    WITH   got_prev_col     AS
    (
         SELECT     id, col, dt     -- DATE is not a good column name (id isn't so good, either)
         ,     LAG (col) OVER ( PARTITION BY  id  -- or omit PARTITION BY clause
                                    ORDER BY      dt
                          )  AS prev_col
         FROM    following
    )
    SELECT     id, col, dt
    FROM     got_prev_col
    WHERE     prev_col     = 'Z'
    ;
    

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) and also publish outcomes from these data.
    Explain, using specific examples, how you get these results from these data. For example, what makes one of the lines 26/02/2013 come in front of the other. Explain what id role plays in this problem. better yet, include a couple of different id values in the sample data.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).
    See the FAQ forum {message identifier: = 9360002}

  • How to create a value fixed for simultaneous program?

    Hi friends,
    I create a simultaneous program with a period of setting...

    In the value set for parameter period, I use the following query:
    -where application_id = 101
    and set_of_books_id =: $PROFILES$ .gl_set_of_bks_id
    and closing_status IN ('o', 'F', 'C')
    order of period_year, period_num' -.

    In my cursor, I have one condition ' where set_of_books_id = '.
    How can I switch the whole above ID of books in the cursor? It does not work when I'm defining another parameter like book and passing this value to the cursor...
    I need this period parameter to return all periods for all the books where we run the concurrent application of... I also need to get all of the books for my cursor IDs...

    I hope I'm making sense... What I'm trying must have the period setting and also an OB id in condition of cursor...
    Rgds,

    Please use the following example

    Start
    FND_GLOBAL. APPS_INITIALIZE (user_id-online-1, resp_id-online 51901, resp_appl_id-online 222);
    end;

    DECLARE
    SET_BKS VARCHAR2 (20);
    BEGIN
    FND_PROFILE. GET ('GL_SET_OF_BKS_ID', SET_BKS);
    DBMS_OUTPUT. PUT_LINE (SET_BKS);
    END;

    Maybe this will help you

    Concerning
    Nitin

  • How to return the sprite object?

    I want to load both image and add each image to each sprite object, like photo one sprite1 and photo b to spriteb, I know that I can load a pictue with the following code:

    loadImage ('a');
    loadImage ('b');
    private void loadImage(imagePath:String):void {}
    var loader: Loader = new Loader();
    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, onImageLoaded);
    Loader.Load (new URLRequest (imagePath));
    }
    private void onImageLoaded(event:Event):Sprite {}
    var loaderInfo:LoaderInfo = event.target as LoaderInfo;
    _loadedBitmap = LoaderInfo.Content as Bitmap;
    Return runPostImageLoad (_sprite);
    }
    private void runPostImageLoad(_sprite:Sprite):Sprite {}
    ... photo of //load
    }

    But I want to make my code like the following, because I want to use sprite1, sprite2 for something else:
    var sprite1:Sprite = loadImage ('a');
    var sprite2:Sprite = loadImage ('b');

    I don't know how to change the loadImage function to return the sprite object. Could someone tell me how to do?

    Thank you

    use:

    private var _sprite:Sprite;

    .

    .

    private void loadImage(imagePath:String):Sprite {}

    var loader: Loader = new Loader();

    Loader.Name = "Loader";

    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, onImageLoaded);

    Loader.Load (new URLRequest (imagePath));

    _sprite = new Sprite();

    _sprite. AddChild ("Loader");

    return _sprite

    }

    private void onImageLoaded(event:Event):void {}

    var loaderInfo:LoaderInfo = event.target as LoaderInfo;

    _loadedBitmap = LoaderInfo.Content as Bitmap;

    runPostImageLoad();

    }

    private function runPostImageLoad (): void {}

    just draw the shape of the irregular part

    If (_loadedBitmap...) {

    _sprite.removeChild (_sprite.getChildByName ("loader"));

    _sprite. Graphics.drawRect (...);

    }

    }

    p.s. Please check the correct and useful.

  • How to return the Id of the Instance in a webservice call?

    Hi all.

    I have a process that is exposed as a WS. I can create instances that calling WS from an external application.
    Now I need return the instance id every time an instance is created in the WS call.
    This 'return' must be almost immediately in the next activity after the start event. I have been able to return more, but can not access the information on the process here.

    How can I do?
    I can't be able to bind the instance Id to an outgoing argument WS.

    Thanks for the help.

    Directly after the start event, place an event to throw the message - I guess that's what you already have. To get the instanceId, use XPath in Associations of data of the event Message to throw away. instanceId is under the "advanced features" such as "ora:getInstanceId(). If you want to return the instanceId of the composite process, use ":getCompositeInstanceId() ora".

    HTH.

  • How to return the Type of function

    I defined a type and a function in the specification. But package body returns error pls-00330 (invalid use of the name of type or subtype). What I am doing wrong? My intention is to write a function that returns a folder that contains two values. For now, I put "null;" as a placeholder.

    -Specifications
    CREATE or REPLACE PACKAGE res.year_qtr AS
    Yq_type RECORD TYPE IS
    (year varchar2 (2),)
    QTR varchar2 (1));
    FUNCTION yq_fun (date_in date)
    RETURN yq_type;
    END year_qtr;

    -body
    CREATE or REPLACE PACKAGE BODY res.year_qtr AS
    FUNCTION yq_fun (date_in date)
    IS BACK yq_type
    BEGIN
    null;
    RETURN year_qtr.yq_type; -get error on this line!
    END;
    END year_qtr;

    Published by: user516543 on March 23, 2009 12:17

    You must declare a variable of this type and the return variable.
    You can not simply to return the type because it is not really a statement of this type.

    --specification
    CREATE OR REPLACE PACKAGE res.year_qtr AS
      TYPE yq_type IS RECORD
        (yr varchar2(2),
         qtr varchar2(1));
      FUNCTION yq_fun (date_in date)
        RETURN yq_type;
    END year_qtr;
    
    --body
    CREATE OR REPLACE PACKAGE BODY res.year_qtr AS
      FUNCTION yq_fun (date_in date) RETURN yq_type IS
        v_ret year_qtr.yq_type;
      BEGIN
        null;
        RETURN v_ret;
      END;
    END year_qtr;
    

Maybe you are looking for