Need totals per month for following SQL select

This SQL is currently giving totals horizontally.How can i add totals for the month vertically as well.
here is my code
select of_last_coy||''||of_last_div "COYDIV",
sum(DECODE(to_char(of_expiry_date, 'MM'),'01', 1,0)) JAN,
sum(DECODE(to_char(of_expiry_date, 'MM'),'02', 1,0)) FEB,
sum(DECODE(to_char(of_expiry_date, 'MM'),'03', 1,0)) MAR,
sum(DECODE(to_char(of_expiry_date, 'MM'),'04', 1,0)) APR,
sum(DECODE(to_char(of_expiry_date, 'MM'),'05', 1,0)) MAY,
sum(DECODE(to_char(of_expiry_date, 'MM'),'06', 1,0)) JUN,
sum(DECODE(to_char(of_expiry_date, 'MM'),'07', 1,0)) JUL,
sum(DECODE(to_char(of_expiry_date, 'MM'),'08', 1,0)) AUG,
sum(DECODE(to_char(of_expiry_date, 'MM'),'09', 1,0)) SEP,
sum(DECODE(to_char(of_expiry_date, 'MM'),'10', 1,0)) OCT,
sum(DECODE(to_char(of_expiry_date, 'MM'),'11', 1,0)) NOV,
sum(DECODE(to_char(of_expiry_date, 'MM'),'12', 1,0)) DEC,
count(*)                                             TOTAL
from mac.oprfile
where of_expiry_date > to_date('01-01-2010','DD-MM-YYYY')
GROUP BY of_last_coy, of_last_div
union
select of_last_coy||''||of_last_div "COYDIV",
sum(DECODE(to_char(of_expiry_date, 'MM'),'01', 1,0)) JAN,
sum(DECODE(to_char(of_expiry_date, 'MM'),'02', 1,0)) FEB,
sum(DECODE(to_char(of_expiry_date, 'MM'),'03', 1,0)) MAR,
sum(DECODE(to_char(of_expiry_date, 'MM'),'04', 1,0)) APR,
sum(DECODE(to_char(of_expiry_date, 'MM'),'05', 1,0)) MAY,
sum(DECODE(to_char(of_expiry_date, 'MM'),'06', 1,0)) JUN,
sum(DECODE(to_char(of_expiry_date, 'MM'),'07', 1,0)) JUL,
sum(DECODE(to_char(of_expiry_date, 'MM'),'08', 1,0)) AUG,
sum(DECODE(to_char(of_expiry_date, 'MM'),'09', 1,0)) SEP,
sum(DECODE(to_char(of_expiry_date, 'MM'),'10', 1,0)) OCT,
sum(DECODE(to_char(of_expiry_date, 'MM'),'11', 1,0)) NOV,
sum(DECODE(to_char(of_expiry_date, 'MM'),'12', 1,0)) DEC,
count(*)                                             TOTAL
from mac.oprfile
where of_expiry_date > to_date('01-01-2010','MM-DD-YYYY')
GROUP BY of_last_coy, of_last_div
order by 1;any help will be highly appreciated

here is the create table statement
CREATE TABLE MAC.OPRFILE
  OF_OPID             VARCHAR2(8 BYTE)          DEFAULT ' ',
  OF_NAME             VARCHAR2(20 BYTE)         DEFAULT ' ',
  OF_COY              VARCHAR2(2 BYTE)          DEFAULT ' ',
  OF_DIV              VARCHAR2(2 BYTE)          DEFAULT ' ',
  OF_DEPT             VARCHAR2(20 BYTE)         DEFAULT ' ',
  OF_DEFQUE           VARCHAR2(20 BYTE)         DEFAULT ' ',
  OF_DEFPSWD          VARCHAR2(10 BYTE)         DEFAULT ' ',
  OF_TELNO            VARCHAR2(15 BYTE)         DEFAULT ' ',
  OF_LAST_COY         VARCHAR2(2 BYTE)          DEFAULT ' ',
  OF_LAST_DIV         VARCHAR2(2 BYTE)          DEFAULT ' ',
  OF_LAST_WH          VARCHAR2(2 BYTE)          DEFAULT ' ',
  OF_LAST_LOGIN_DATE  DATE,
  OF_LAST_LOGIN_TIME  VARCHAR2(6 BYTE),
  OF_SALES_DEPT       NUMBER(2)                 DEFAULT 0,
  OF_USER_TYPE        VARCHAR2(1 BYTE)          DEFAULT ' ',
  OF_MENU_TYPE        VARCHAR2(1 BYTE)          DEFAULT ' ',
  OF_MENU_PROG_IDS    VARCHAR2(1 BYTE)          DEFAULT ' ',
  OF_EMAIL_ADDR       VARCHAR2(70 BYTE)         DEFAULT ' ',
  OF_ID_NUMBER        VARCHAR2(13 BYTE),
  OF_TAKEON_DATE      DATE,
  OF_EXPIRY_DATE      DATE,
  OF_FAXNO            VARCHAR2(15 BYTE),
  OF_USER_CATEGORY    VARCHAR2(1 BYTE)
)here is the insert statements for the table:
Insert into MAC.OPRFILE
   (OF_OPID, OF_NAME, OF_COY, OF_DIV, OF_DEPT, OF_DEFQUE, OF_DEFPSWD, OF_TELNO, OF_LAST_COY, OF_LAST_DIV, OF_LAST_WH, OF_LAST_LOGIN_DATE, OF_LAST_LOGIN_TIME, OF_SALES_DEPT, OF_USER_TYPE, OF_MENU_TYPE, OF_MENU_PROG_IDS, OF_EMAIL_ADDR, OF_ID_NUMBER, OF_USER_CATEGORY)
Values
   ('tilla', 'Tilla de Beer', '01', '08', '150', '0108so3', ' ', '018 4068200', '01', '08', '01', TO_DATE('04/13/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '075616', 2, 'N', 'F', 'Y', '[email protected]', '6510120083086', 'U');
Insert into MAC.OPRFILE
   (OF_OPID, OF_NAME, OF_COY, OF_DIV, OF_DEPT, OF_DEFQUE, OF_DEFPSWD, OF_TELNO, OF_LAST_COY, OF_LAST_DIV, OF_LAST_WH, OF_LAST_LOGIN_DATE, OF_LAST_LOGIN_TIME, OF_SALES_DEPT, OF_USER_TYPE, OF_MENU_TYPE, OF_MENU_PROG_IDS, OF_EMAIL_ADDR, OF_ID_NUMBER, OF_USER_CATEGORY)
Values
   ('atr', 'Archi Truder', '01', '17', '130', '0117ge2', ' ', '011 8714600', '01', '17', '01', TO_DATE('04/12/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '081537', 1, 'N', 'P', 'N', '[email protected]', '6804165184085', 'U');
Insert into MAC.OPRFILE
   (OF_OPID, OF_NAME, OF_COY, OF_DIV, OF_DEPT, OF_DEFQUE, OF_DEFPSWD, OF_TELNO, OF_LAST_COY, OF_LAST_DIV, OF_LAST_WH, OF_LAST_LOGIN_DATE, OF_LAST_LOGIN_TIME, OF_SALES_DEPT, OF_USER_TYPE, OF_MENU_TYPE, OF_MENU_PROG_IDS, OF_EMAIL_ADDR, OF_ID_NUMBER, OF_USER_CATEGORY)
Values
   ('rezano', 'Rezano Sauls', '20', '01', '110', '2001dn2', ' ', '011 897-2100', '20', '01', '01', TO_DATE('04/13/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '064949', 17, 'N', 'P', 'N', '[email protected]', '7804205196080', 'U');
Insert into MAC.OPRFILE
   (OF_OPID, OF_NAME, OF_COY, OF_DIV, OF_DEPT, OF_DEFQUE, OF_DEFPSWD, OF_TELNO, OF_LAST_COY, OF_LAST_DIV, OF_LAST_WH, OF_LAST_LOGIN_DATE, OF_LAST_LOGIN_TIME, OF_SALES_DEPT, OF_USER_TYPE, OF_MENU_TYPE, OF_MENU_PROG_IDS, OF_EMAIL_ADDR, OF_ID_NUMBER, OF_USER_CATEGORY)
Values
   ('mwil', 'Monique D Wilson', '06', '17', '020', '0601pdf', ' ', '011 8615200', '06', '12', '95', TO_DATE('04/13/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '085531', 1, 'N', 'P', 'Y', '[email protected]', '8301300517087', 'U');
Insert into MAC.OPRFILE
   (OF_OPID, OF_NAME, OF_COY, OF_DIV, OF_DEPT, OF_DEFQUE, OF_DEFPSWD, OF_TELNO, OF_LAST_COY, OF_LAST_DIV, OF_LAST_WH, OF_LAST_LOGIN_DATE, OF_LAST_LOGIN_TIME, OF_SALES_DEPT, OF_USER_TYPE, OF_MENU_TYPE, OF_MENU_PROG_IDS, OF_EMAIL_ADDR, OF_ID_NUMBER, OF_USER_CATEGORY)
Values
   ('sdhl', 'Salebona Dhlamini', '06', '17', '001', '0601ge3', ' ', '011 8710000', '50', '01', '01', TO_DATE('04/13/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '084638', 1, 'N', 'P', 'N', '[email protected]', '7901105331088', 'U');herewith is output from current SQL:
COYDIV , JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP
, OCT, NOV, DEC,TOTAL
0101 , 4, 0, 1, 0, 0, 0, 0, 0, 0
, 0, 0, 0, 5
0102 , 0, 3, 0, 0, 0, 0, 0, 0, 0
, 0, 0, 0, 3
0103 , 0, 1, 1, 1, 0, 0, 0, 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 0, 8
Help will be much appreciated.thank-you

Similar Messages

  • I have lightroom.  My photos are stored on an external disk drive with a backup disk.  With iCloud, will all of my photos go to the cloud?  Will I still need the external drives? Is the $9.99 per month for just one year or for always?

    I am an amateur photographer and have lightroom.  My photos are stored on an external disk drive with a backup disk.  With iCloud, will all of my photos go to the cloud?  Will I still need the external drives? Is the $9.99 per month for just one year or for always? 

    If the iTunes database files are on that drive, launch iTunes with the Shift key(Windows) or Option key(Mac OS X) held down, select Choose Library, and navigate to it. The computer may need to be authorized to play protected content, and if the library contains rented movies, those won't play.
    If not, import the content to an iTunes library.
    (100371)

  • Can't subscribe for 120 mins and 90 rupees per month for calling to India

    I want to subscribe for 120 mins and 90 rupees PER MONTH for calling to India but when I select this subscription the only options it gives me are 120 mins and 256.50 rupees for 3 months and 120 mins and 918 rupees for 12 months. I don't want to spend extra money for 3 or 12 months. I need it only for 1 month. Please don't tell me this is not an option. How can I fix this??

    Its best to phone up and explain clearly what you want.
    You will be calling the UK, but as we have such a diverse multiracial population you can still have trouble
    To be honest I  have trouble when I ring most call centres, some do have some very broad regional accents.
    toekneem
    http://www.no2nuisancecalls.net
    (EASBF)

  • Being charged £12.00 per month for BT Sport when I...

    Hello,
    I have previously sent this to a support email address but have received no response.
    I want to sign up to BT TV and get a Youview box, but when checking my account, I saw that I am getting changed £12.00 per month for BT Sport. This is a service which I do not even use, I signed up to it as a customer service advisor on the telephone advised that it was free to me as I am an Infinity broadband customer.
    I need this resolved, I am perfectly happy with the phone and broadband service we receive from you and I am excited to get BT TV, but I really am disappointed about this (it will explain why the budget kept going AWOL!) This appears to have been happening since November 2013, with some obscure charges of around £7.00 in other months. I want this service cancelled and I would really appreciate the charges for this service reimbursed.
    Kind regards,
    Craig
    Solved!
    Go to Solution.

    I think you will find that the charge is for YouView content provided by BT.
    I have asked a moderator to provide assistance, they will post an invite on this thread.
    While you are waiting
    If you would like to try Live Chat they may be able to help you.
    They are the only BT employees on this forum, and are a UK based team of people, who take personal ownership of your problem.
    Once you get a reply, make sure that you are logged into the forum, then click on their name, you will see a screen like this. Click on the link as shown below.
    Please do not send them a personal message, as they may not be on duty for a long time, and your message will not be tracked properly.
    For your own security, do not post any personal details, on this forum. That includes any tracking number you are give.
    They will respond either by phone or e-mail within 5-6 working days.
    Please use the tracked e-mail, to reply, not via the forum. Thanks
    This is the form you should see when you click on the link. If you do not see this form, then you have selected the wrong link.
    When you submit the form, you will receive an enquiry number, so please keep a note of it
    There are some useful help pages here, for BT Broadband customers only, on my personal website.
    BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones.

  • When I pre ordered my iphone 6 i was told I was going to get an additional 1 gig of data per month for a year.  It even shows it on the receipt i received with the phone.  When will I see that reflected on my account.  I have had my new phone for a week a

    When I pre ordered my iphone 6 i was told I was going to get an additional 1 gig of data per month for a year.  It even shows it on the receipt i received with the phone.  When will I see that reflected on my account.  I have had my new phone for a week and used tons more data than usual and am hoping that will save me this month.

    concretedonkey, I'm glad you were able to take advantage of this offer when you ordered your new iPhone 6. I can certainly review your account to ensure this was added for you. Please reply to the direct message I have sent you.
    AndreaS_VZW
    Follow us on Twitter @VZWSupport

  • How do I download Photoshop for windows xp and vista.... I currently pay per month for photoshop and a computer running vista i ned to install photoshop on two aditional machines. How can I download, photoshop says I have an os that is no longer supported

    I have a computer running windows vista that I pay per month for photoshop, I want to use photoshop on two other computers I have, not that it matters but they are both identical hardware wise, and software one runs xp and the other runs vista, I can upgrade but I am not intrested in other os. When I attempt to download I am told that my os is no longer supported. Now i know that I could find an offline version and should be able to get it installed but im not sure of a safe site that provides the iso or install exe. I want to use the other two computers because they have touch interface early computer/tablet highbird. thanks in advance.

    Michaelt65951582 I am sorry but you will need to run at least the minimum operating system to use Photoshop.  You can find the system requirements at System requirements | Photoshop.  I would recommend upgrading to Windows 7 or later.  You may find that your computer can support the more recent operating system depending upon the hardware installed.

  • I have to pay per month for using airport express?

    I have to pay per month for using airport express?

    You would need to investigate which Internet Service Providers (ISPs) are available in your area. You can then contact them about pricing for their services. Typically, you pay more for faster Internet upload/download speeds.
    Most ISPs will provide you with a modem and get the service established at your home. From there, you would connect the AirPort Express to this modem to provide a wireless network.

  • When I commenced subscriptions for PhotoshopCC i was billed $19.99 per month.  The advertised fee is now $9.99 per month for a single product.  How do I change to the lower payment plan.?

    when I commenced subscriptions for PhotoshopCC i was billed $19.99 per month.  The advertised fee is now $9.99 per month for a single product.  How do I change to the lower payment plan.?

    The advertised fee is now $9.99 per month for a single product.
    Where are you seeing that? I still see Single App membership at US$19.99/month.
    Creative Cloud free trial & plans : Adobe Creative Cloud
    The only US$9.99/month offering is Photoshop+Lightroom.
    So I guess you're asking to swap from the Photoshop Single App Plan to the Photography Plan (PS+LR)?

  • Brief report of about 2 months for the sqls run under a specific user ?

    Hi,
    Is there a way i can get the brief report of about 2 months for the sqls run under a specific user in Oracle 11g.
    thanks in advance

    913410 wrote:
    Yes,
    auditing is enabled
    SQL> show parameter audit;
    NAME                                 TYPE        VALUE
    audit_file_dest                      string      /u01/app/oracle/admin/PRCMTDB/
    adump
    audit_sys_operations                 boolean     FALSE
    audit_syslog_level                   string
    audit_trail                          string      DBthen how to get the informationabove is necessary, but not SUFFICIENT
    default Oracle behavior is that NO specific actions are audited.
    You would have had to manually enable AUDIT for all SQL statement by single user

  • Lightroom 5.7 will not update even through I pay the $9.99 per month for Photoshoto CC and lightroom ?

    Lightroom 5.7 will not update even through I pay thr $9.99 per month for Photoshop CC and Lightroom ?

    Hi Glenys,
    Here's another forum thread that may help (related discussion), if you can't find the new version:
    I have Creative Cloud for Photographers. How do I get Lightroom CC?

  • Being billed per month for phone protection

    I've just goten billed around $15 for either a warranty or so for my Iphone5s I'd like to cancel the warranty. Once purchacing my phone I was told I'd be billed per month for the warranty but the first month's free. I've lost the phone number I'm to call so I can cancel that protection.

    Bill details on my BOA account. "CHECKCARD 01/24 DIAMOND WIRELESS 1014 SANDY UT : -$9.99" and CHECKCARD 01/24 DIAMOND WIRELESS 1014 SANDY UT -$6.99"

  • Why don't I qualify for the special offer of £8.00 odd per month for Photoshop CC despite already ha

    Why don't I qualify for the special offer of £8.odds per month for Photoshop CC despite already having CS 5 on my computer?

    Are you talking about the Photoshop Single App subscription?
    or the Photoshop Photography Program ( = Photoshop + Lightroom + extras)?
    https://creative.adobe.com/plans/offer/photoshop+lightroom

  • I pay 9.99 usd per month for the Creative Cloud Photography Plan.  I mostly use LR... can i download / use the more powerful Photo Shop for this contract price also?

    I pay 9.99 usd per month for the Creative Cloud Photography Plan.  I mostly use LR... can i download / use the more powerful Photo Shop for this contract price also?
    Asking for help here. 

    Yes, the Creative Cloud photography plan includes photoshop & Lightroom.
    Regards
    Rajshree

  • My account is active and paying per month for Acrobat Pro. Why I cannot open files and the screen asks for serial number?

    my account is active and paying per month for Acrobat Pro. Why I cannot open files and the screen asks for serial number?

    I don't work for Adobe but it seems to me you might be signing in to Acrobat with the wrong Adobe ID.
    Check the Adobe ID you use in Acrobat.
    Check this Adobe ID on Adobe's to make sure that it has an active subscription.

  • I am being charged £46.88 per month for cs6, bridge AI etc and i only need bridge and CS6.. Adobe says i have to pay that amount  to get the two i need? Anyone else know i feel i am being ripped off!

    Does anyone know if you can get just CS6 and Bridge and the cost? I am paying £46.88 a month for everything i dont need

    The full Creative Cloud of applications are $50/month.
    A single app $20 a month
    And for Photographers $10/month  Photoshop/Lightroom  Bridge CC is a free app for all levels.
    If you cannot meet those conditions, you can purchase the permanent license CS6 products.
    https://www.adobe.com/products/catalog/cs6._sl_id-contentfilter_sl_catalog_sl_software_sl_ creativesuite6.html?start=10
    I don't work for Adobe, but will at least let you know you can still purchase a permanent license.
    Gene

Maybe you are looking for

  • "please insert a blank dvd-r disc" over & over....

    Hi, I'm running iDVD 4 and trying to burn a movie+slideshow I made in imovie onto memorex DVD+R's. I click 'Burn', it asks for a blank disc, I insert a blank disc, after 5 seconds, it ejects and asks for a blank disc over and over. I've tried quite a

  • JTextField - SDK 1.4.0_01

    Question, I've created 3 JTextFields and set them all to the same length. Initially opening the GUI, everything looks fine. But if text is in any of the 3 JTextFields when the GUI is updated the JTextField expands because of the entered text. How do

  • IRPStacksize still valid?

      I see another article asking this simple question and never answered. Applications such as BackUp Exec as well as random disconnects to iSCSI drives during our testing in 2012 R2 all suggest the ol' IRPStackSize value needs to get set (Symantec sug

  • Easy Link to Install Oracle 9i at Solaris.

    I'm looking for an easy link to Install & Manage Oracle 9i at Sun Solaris Box.

  • AF:QUERY : JBO-25058 when we add duplicate instance of multi select enabled and search

    Hi Getting JBO-25058 error when we add duplicate instance of multi select enabled attribute from Add Fields and click on search Our requirement is to add validation if search panel has duplicate instance of multi select enabled attribute but this err