How to sort on the period of one month

Hello

I have a doubt on the date column sorting. IE, how to print the values of Jan - Dec. I heard all using case statement, it is possible. y at - it another option?

with t as
(select to_date('12-feb-95') union dt double all the)
Select to_date('12-apr-95') union dt double all the
Select to_date('12-jan-95') union dt double all the
Select to_date('12-apr-95') union dt double all the
Select to_date('12-dec-95') double dt)
Select to_char (dt, 'month'), count (*) t
To_char Group (dt, 'month')
order by Lun;

I need output like,

on 1 January
on 1 February
April 2
December 1
with t as
(select to_date('12-feb-95') dt from dual union all
select to_date('12-apr-95') dt from dual union all
select to_date('12-jan-95') dt from dual union all
select to_date('12-apr-95') dt from dual union all
select to_date('12-dec-95') dt from dual)
select to_char(dt,'month') mon,count(*) from t
group by to_char(dt,'month')
order by to_date(to_char(dt,'month'),'MON');

MON                         COUNT(*)
--------------------------- ----------------------
january                     1
february                    1
april                       2
december                    1                      

4 rows selected

Tags: Database

Similar Questions

  • XP hangs after the period of one month

    Hello

    For the third time in 3 months I had to reinstall a Toshiba Satellite Pro with Windows XP. After about 3 to 4 weeks, the laptop starts and stops at the start. It keeps hanging when loading personal settings. When I use the recording mode it keeps always suspended. The only way to make it work again is to reinstall windows XP. Anyone know what is happening?

    Thanks for the reply.

    Hi Molema,

    You have installed Windows XP Toshiba disk recovery or normal Microsoft installation disc?

    To be honest it is difficult to say why this is happening, but I think it's software related issue s. No one knows what programs you have probably is also a virus or a Trojan. If you install XP again, I recommend a good software like AntiVir antivirus or something else.

  • How can I chage the direction of one of my extended in MS XP desktop monitors

    How can I chage the direction of one of my extended in MS XP desktop monitors

    In your notifications area, right-click on the icon for your graphics driver. Since I did not lnow what grapiics driver you have, I can't help you much here. However, this will give you many settings and menus that should include one to change the orientation of a specific moniter.

  • No approval of the last period of one month.

    Hello

    No approval of the last period of one month. Totally in confusion. Anyone know what the problem is.  We are totally confused. Help, please.

    You say that your applications are queued for a month now?
    These days, it's rather normal to have rather long waiting times until the apps are approved, it is mainly because of the Port-A-tuna (but I have suggested, that you browse through some other threads on this forum for more information).

    A month is now the peak time for approved applications, so it will only take more time to ensure that your applications will be approved/rejected.

    Sometimes you can speed up the process by BlackBerryDev Twitter, but it does not always help. There are also some BlackBerry people on this forum who can help, so contact them is an option to consider: samyotte

    I hope that your applications are approved soon :-)

  • How can I chang the language from one to the other?

    How can I chang the language from one to the other?

    Change the language of Adobe Creative Cloud applications

  • How can I reinstall the Photoshop from one computer to another? I didn't need a second license...

    How can I reinstall the Photoshop from one computer to another? I didn't need a second license...

    You are allowed to install Photoshop on two computers. Recent versions allow to choose if they are versions Mac or Windows, or one of each!

  • I am using the trial version of adobe photoshop. I want to buy it later not within the period of 4 months. So, how can I cancel my payment option

    I am using the trial version of adobe photoshop. I want to buy it later not within the period of 4 months. So, how can I cancel my payment option

    Hi mohammadr42362249,

    I see that there is no update on your account payment information.

    You can always contact our sales team customer care and make a purchase for the new http://www.adobe.com/products/request-consultation/marketing-cloud.html here

    https://helpx.Adobe.com/contact.html

    I hope this helps!

  • How to make all the fields on one page read only (for the recipient) without having to make each field read-only?

    How to make all the fields on one page read only (for the recipient) without having to make each field read-only?

    Hello Jmbtexas4,

    By default, you will need to individually click on the fields of the form and check the 'read only' and save it. From now on, it is not possible to select all together and make the changes.

    -Usman

  • How do sort you the order account shown in the folders pane in Thunderbird?

    When dealing with multiple email accounts in Thunderbird, how can I arrange the order that they are listed in the pane of the files of the main window, the broad view, the version of Mac OS X? When I add new accounts, they placed in the order want to Thunderbird, is usually not the one I need.

    Shift, control, Option, or command key does not move them. With the help of v24.6.0 on OS X 10.7.5.

    https://addons.Mozilla.org/en-us/Thunderbird/addon/manually-sort-folders/

    http://chrisramsden.vfast.co.UK/3_How_to_install_Add-ons_in_Thunderbird.html

  • How can I reduce the size of one of 'My images' print to?

    How can I reduce the size of the 'My pictures' draws what size I want (so I can print six or eight copies of the same image on a single sheet of 8.5 "x 11")?

    You must right click on the image and then press on print and work your way through the wizard Methoeds, this should allow you to choose what size to make your prints.

  • How do set you the time, date and month on the HP Officejet Pro 8600 more

    How do you set the month, Date and time on the Officejet Pro 8600 more?

    Hello

    The screen of the device press setup and go to prefferances, and then press ok. There you should see the option "time and date". You can set it from there.

  • How do we install the all-in-one for my photosmart 7280

    I just bought a new macbook with mac OS X 10.9.4 and I just cannot print pictures of her on my photosmart 7280. the generic driver provided in USS also seem to, I only print in B & W. I can't understand how to scan or use any other feature that I have on my PC which runs the full features of HP all-in-one software.  Thanks for your help

    SOLVED ASU has not installed the authentic hp driver. It was download and install a generic driver. So I downloaded the full package manually on the apple support site and installed. Work very well. Works works, photo printing, scanning and fax. I also have the leverage of available ink.

    Here is the link:

    http://support.Apple.com/kb/dl907

  • How to sort by the most recent with folders on top?

    Is there a way to sort files by date (first for the setback, current topics) but keep files on top of the directory structure? If so, how? I used to have this setting and it disappeared.

    To be clear, I'm looking for something like this

    [folder] abc
    [folder] def
    IGS [folder]
    [file] no matter - updated 11/01/11
    [file] file name is not serious - modified 10/01/11
    [file], you get the idea - modified on 04/01/11
    [file] and it was 2010 - amended 12/29/10

    Does make sense? Again, I had this before setting and he disappeared. What happened, and how do I get it back? A reboot it does not solve for me. I tried to right click "sort by" and do not see this option. ALL I want are the files on top... I don't like on the folder names.

    Thank you!

    The guys that the solution to this problem is on the first page, you must view the files in the folder in detail to see each way you can sort.

    Then you click Update, then shift + click on the name, it will fix the sorting in order to always put first records.

  • Overlapping address space question - how to NAT inside the traffic to one address different range on SAA for comms with 3rd party VPN?

    We already have a connectivity of IPSEC VPN site to site with a 3rd party.

    They must be able to access a couple of servers on our internal network but the problem, it's the subnet these servers are hosted on clashes with the address space they already used elsewhere. Thus, they asked if we can put in place a new subnet and have our firewall (running v7.2) ASA NAT the traffic to and from our servers ' real' internal addresses.

    for example

    • 3rd party 10.10.10.0/24 subnet
    • Our subnet 10.20.20.0/24 (but this clashes with the 3rd part of the address elsewhwere space)
    • Our 'real' internal server addresses are 10.20.20.1 and 10.20.20.2

    How do we setup NAT on our ASA translating internal addresses 'real' of these servers for some other addresses that don't clash?

    that is that the 3rd party is concerned, they would simply have to communicate with this 'new' subnet, say, 192.168.20.0/24 and our ASA firewall NAT traffic accordingly to allow some comms unfold?

    (And it should affect only comms on these servers for the 3rd party - NOT for one of our other multiple VPN connections! "And should not affect the other comms from the servers themselves!).

    That's what I've tried so far, for one of the servers, without success:

    On ASA:

    !

    access-list 1 permit line 3rdpartysite extended ip host 192.168.20.1 10.10.10.0 255.255.255.0
    !
    access-list SERVER-NAT line 1 permit extended ip host 10.20.20.1 10.10.10.0 255.255.255.0
    !
    static (inside, outside) 192.168.20.1 public - access NAT SERVER list

    "sh xlate" indicates:

    192.168.20.1 global local 10.20.20.1

    Can someone help with the necessary NAT configurations on the ASA?

    Thank you!

    'Clear xlate' after you have configured NAT statements?

    When you try to ping from the 10.20.20.1, get it to the ASA? You have an ACL on this interface that would block the ping? Also, can you run capture packets on the ASA to see if the ASA receives even the traffic?

    What is the subnet mask of the 10.20.20.1 host? I guess it's 255.255.255.0?

    You don't need something specific on the ASA with regard to the delivery of the 192.168.20.1.

  • How can I pass the value of one for two binding settings

    Hi all
    I have a search query

    Select Distinct CONSOLIDATION_SUMMARY_ID, CREATION_DATE CREATED_BY BATCH_ID, PROCESS_FLAG, ERROR_MESSAGE, CUSTOMER_ID, BILLING_FREQUENCY
    CONSOLIDATION_LEVEL, SOLD_TO_ORG_ID, SHIP_TO_ORG_ID, TRANSACTIONAL_CURR_CODE, INVOICE_TO_ORG_ID, PRICE_LIST_ID
    ORIG_SYS_DOCUMENT_REF, INVENTORY_ITEM_ID, ORGANIZATION_ID, ORDERED_ITEM, ORDERED_QUANTITY, UNIT_LIST_PRICE
    UNIT_SEELING_PRICE, ORDER_QUANTITY_UOM, ORDER_NUMBER, ORDER_DATE, INVOICE_NUMBER, INVOICE_DATE
    FEE_CALCULATION_WORKSHEET_PDF, TRADE_DETAILS_PDF, INVOICE_REPORT_PDF, PRICING_ATTRIBUTE_CONTEXT
    PRICING_ATTRIBUTE, PRICING_ATTR_VALUE_FROM
    of xxcurrnx.xxcur_trade_consol_summary XXSTR
    WHERE XXSTR. BATCH_ID = NVL (: 1, XXSTR.) BATCH_ID)
    and XXSTR. CUSTOMER_ID = nvl (: 2, XXSTR.) CUSTOMER_ID)

    But I need to pass only one value to this query: throw the code below

    public void passTocusttrxn (String vcustid)
    {
    System.out.println ("trxn vo customer id:" + vcustid);

    XxcurtradeconsummaryVOImpl vOrdnumb = getXxcurtradeconsummaryVO1 ();
    vOrdnumb.setWhereClauseParam(0,vcustid);
    vOrdnumb.setWhereClauseParam(1,null);
    vOrdnumb.executeQuery ();

    System.out.println ("the query that is run after is:" + vOrdnumb.getQuery ());
    }

    But it throws the exception below.
    java.sql.SQLException: parameter IN or OUT to missing index: 1

    could you please tell me how can I achieve this.

    Thank you

    Hello

    I hope that the problem solved, pls, close it.

    Regads
    Meher Irk

Maybe you are looking for