Help! Need to change this statement to a Count (*)

Please help me to change it to a Count (*), because I don't want to see the detail.

Select distinct
partner, region, od. ORDER_AFFILIATE_NAME,
Oh.external_order_number,
Ain.get_g1 (queue_type) offers,
Case
When disp.category = 100 Then 'ORDER'
When disp.category = 200 Then 'ACCESS'
When disp.category = 300 Then 'DSL'
When disp.category = 600 Then 'IPTV'
"When disp.category = 700 Then'INTERNET"
When disp.category = 800 Then 'VOIP'
End up like product_category,
To_char(OH.created_ts, 'yyyy-mm-dd HH24:mi:ss') CREATE_DATE

-Case when ip.offer_type = "IPDSLAM" or instr (ip.display_name, "-d") > 0
THEN 'IP - LAN'
ELSE 'FTTN.
end as product_type

Case
When disp.state = 4 and disp.state = 9 or disp.state = 21 or 22 = disp.state then 'cancelled '.
When disp.state = 17 then "NRFC cancelled.
When disp.state = 7 Then 'incomplete '.
When disp.state = 3 or disp.state = 8, then "Finish".
When disp.state = 6 or disp.state = 10 and disp.state = 13 or disp.state = 14 then 'pending - other ".
When disp.state = 19 disp.state = 20 then "sent".
When disp.state = 21 or disp.state = 22 then "Cancelled - CSUS.
When disp.state = 23 or 24 = disp.state then 'Order Confirmation '.
When disp.state = 1 or disp.state = 2 or disp.state = 15 then "receipt".
Another 'other '.
End as STATE_desc


of AIN.impl_oh_order_header oh,.
Ain.impl_order_data od,
DISP AIN.sncr_order_curr_disp,
AIN.impl_package ip
where oh.created_ts between to_date ('2013-02-04', ' yyyy-mm-dd "")
and to_date ('2013-02-11', ' yyyy-mm-dd "")
and oh.order_type = 'COMMAND '.
and disp.category to (200, 300, 600, 700, 800)
and disp.state! = '5'
and uscs = 0
and disp.transaction_id = oh.transaction_id
and od. transaction_id = oh.transaction_id
and ip.transaction_id = oh.transaction_id
and ip.package_type = 'PACKAGE '.
and ip.parent_package_id is null
and ip.product_type = 'COMMAND '.

FORUM THREAD IN DOUBLE AND EVIL!

Please mark this ANSWER question you have posted in the wrong forum, and now you have it posted in the SQL and PL/SQL forum where it belongs.
Help, please! Need to modify this Script to do a Count (*)

Tags: Database

Similar Questions

  • Current month data: Help needed to change this code a return procedure

    Hello people I this scenario where I need to change the code so that there return data compared to the month current day to the day before if it's a daily report and data from the months preceding it is a monthly report.
    I have no idea how to change this code below. Currently the code returns the data of the monthly reports for the previous month. Someone has any idea how to change so that the code meets the requirements of daily and monthly reprts.



    BEGIN

    If v_lowdate is null or v_highdate is null then
    Select to_number (to_char (sysdate, 'DD')) double v_cur_day;
    If v_cur_day < 25 may
    -It's for the month to run
    Select Add_Months (trunc (sysdate, 'MONTH'), - 1).
    IN V_LOWDATE
    FROM DUAL;

    SELECT Last_Day (ADD_Months (Sysdate-1)) INTO V_Highdate From Dual;
    on the other
    -This is for the current delivery month
    Select trunc (sysdate, 'MONTH') IN V_LOWDATE FROM DUAL;

    SELECT Last_Day (Sysdate) IN the double V_Highdate;
    end if;

    end if;




    Thank you

    Published by: user11961230 on September 30, 2009 20:34

    Hello

    The revised version of the code below, statement a daily report on every day except the 1st of the month, will include the dates of the first of the month through yesterday.
    If a daily report is requested on the 1st of the month, then it will start the 1st of the month form last through yesterday (which is the last day of the previous month, making it the equivalent of a monthly report). I've added comments in the code on the lines that check these things.

    v_cur_day := TO_CHAR (SYSDATE, 'DD');
    
    IF  report_type = 'D'                         -- Daily report
    AND v_cur_day > '01'                         -- (except when run on 1st of the month)
    THEN                                   -- will cover from
    
         v_lowdate  := TRUNC (SYSDATE, 'MONTH');          -- 1st of this month to
         v_highdate := TRUNC (SYSDATE - 1);          -- yesterday
    ELSIF  report_type = 'M'                    -- Monthly report
    OR     (     report_type = 'D'               -- (or Daily report
           AND     v_cur_day = '01'               -- if run on the 1st of the month)
           )                              -- will cover from
         v_lowdate  := ADD_MONTHS ( TRUNC (SYSDATE, 'MONTH')
                         , -1
                         );               -- 1st of last month
         v_highdate := TRUNC (SYSDATE, 'MONTH') - 1;     -- last day of last month
    END IF;
    

    The above code always makes all the previous month, a monthly report. If you decide you want to want to do the month in progress (not the previous month) when a monthly report is run the or after the 25th of the month (as your original code), then use the version below:

    v_cur_day := TO_CHAR (SYSDATE, 'DD');
    
    IF  report_type = 'D'                         -- Daily report
    AND v_cur_day > '01'                         -- (except when run on 1st of the month)
    THEN                                   -- will cover from
    
         v_lowdate  := TRUNC (SYSDATE, 'MONTH');          -- 1st of this month to
         v_highdate := TRUNC (SYSDATE - 1);          -- yesterday.
    ELSIF  (     report_type = 'M'               -- Monthly report
           AND     v_cur_day <= '24'               -- (if run between the 1st and 24th,
    OR     (     report_type = 'D'               -- or Daily report
           AND     v_cur_day = '01'               -- if run on the 1st of the month)
           )                              -- will cover from
         v_lowdate  := ADD_MONTHS ( TRUNC (SYSDATE, 'MONTH')
                         , -1
                         );               -- 1st of last month to
         v_highdate := TRUNC (SYSDATE, 'MONTH') - 1;     -- last day of last month.
    ELSIF  (     report_type = 'M'               -- Monthly report
           AND     v_cur_day >= '25'               -- (if run on or after the 25th of the month)
           )                              -- will cover from
    THEN
         v_lowdate  := TRUNC (SYSDATE, 'MONTH');          -- 1st of this month to
         v_highdate := LAST_DAY (TRUNC (SYSDATE));     -- last day of this month
    END IF;
    
  • Need to change "this notification requires no response."

    Dear Experts,

    I'm new to the workflow.  I did notice FYI, but action is needed from the link in the notification. It shows "Information this notification does not require a response" as it is a notification of FYI.

    My customer requests to change this as "this notification requires your answer."

    Please suggest me that there is that no workaround is here to change.

    Thanks in advance.

    Kind regards

    Muthu

    You may need to change the standard model was used for FYI that is usually: Workflow Open for info Mail

    It will be a part of the article standard system: type of item of Mailer (WFMAIL).

    Download the WF Designer:

    Note 261028.1

    Title: How to download and install the latest Workflow Oracle

    Constructor (Client tool) for the E-Business 11i

    Steps to follow:

    1. open the generator and access the instance to open the system item: item of Mailer (WFMAIL) type.

    2. expand the 'Message' section to locate: Workflow Open FYI Mail (OPEN_MAIL_FYI).

    3. click on the message and access the body TAB to change the current model from

    Oracle Workflow notification (for info)

    & COMMENT

    ________________________________________________________________________

    & BODY

    TO

    "This notification requires your answer."

    4. save the changes.

    5. the load to the server and validate.

    If you consider your question/problem answered/resolved,

    Please do not forget to mark the Correct/good responses in the thread. It helps other users of the community to identify the solution quickly!

    Kind regards

    Ajith

  • How can rejection of the Amazon - the link to Adobe AIR in your app update needs - I change this

    Here is a message I received from Amazon:

    Unit tested : Motorola Droid (2.3), HTC Evo (2.3.3), Samsung Galaxy Tablet (2.2)

    Question : The link in your Adobe AIR application must be updated so that visitors are taken directly to the page of Adobe AIR app on the Amazon Appstore. The download URL is http://www.amazon.com/gp/mas/dl/android?p=com.adobe.air steps: I) launch the application. (II) press 'Install' > > «Appstore» Observe that the application accesses the home page of the Amazon app store for Adobe Air installation.

    I'm guess I could change this in my xml file:

    I change the URL in this line than what they provided (http://www.amazon.com/gp/mas/dl/android?p=com.adobe.air):

    <? XML version = "1.0" encoding = "UTF-8" standalone = 'no '? >

    " < application xmlns =" http://ns.Adobe.com/air/application/2.6 ">

    However, when it is published it always changes it back to the old address. How to prevent this?

    Thank you.

    I think I found the couresty of Benny 7500 response on August 11, 2011 09:18.

    For me the work of editing the file Markets.xml to:

    "C:\Program Files\Adobe\Adobe Flash CS5.5\en_US\Configuration\Android\Markets.xml"

    and the replacement of key of Amazon Appstore

    http://www.Amazon.com/GP/MAS/DL/Android?p=com.Adobe.air"/ >

    That's all!

  • Hello! Is there a way to create a shortcut that allows you to toggle the checkbox "Allow pages to choose their own colors, instead of my selections above" located in Tools/Options/content/colours? I need to change this setting repeatedly and need to speed

    I looked for the Add - ons that could automate this configuration change, but nothing helped. Only actions of web page can be saved in a macro, but no change in configuration.

    A shortcut to access the appropriate dialog box would help as well. I could manually check / uncheck box saving all stages several necessary to get there. But I don't him not found anywhere.

    I thank very you much for any help you can provide me.

    Best regards

    Alex

    I have a checkbox on the PrefBar to pass this parameter (browser.display.use_document_colors).

    PrefBar can also assign a shortcut buttons and checkboxes.

  • Help needed to change the vision of the USB folder

    When I open the external hard drive, his point of view is like the thumbnail (a single file in the Middle above and others all to the baseline in a row). I want to change it to put all the files and folders on the screen as on the higher office. If someone could help would be appreciated.

    In the title bar of this window to the rt, click the drop down arrow (change your point of view)

  • clicked "never allow" for a program to run. need to change this.

    I recently downloaded the steam 2 Team Fortress and when I went to run the program, a window pops up with the buttons "never allow, allow once, always allow". I have been followed and accidentally clicked on never leave out. now when I try to run team fortress2 it closes every time. How can I change I can let it run?

    Haha! I just fixed it. Apparently if you just keep trying to open it I just have a window that came and said "firefox has noticed your attempts to this program. You want to allow it? "And I was able to change the setting. Thank you for your interest in this question tho.

  • [help needed] Several insert - SQL statement

    Hello

    This is my table:

    {code}

    create table test

    (

    Identification number,

    DS varchar (6).

    start_date date

    );

    {code}

    There is data in the table.

    {code}

    Insert test values (1, 'DS1982', TO_DATE ('01.03.2014 ',' DD.)) MM YYYY'));

    Insert test values (2, 'DS1982', TO_DATE ('01.04.2014 ',' DD.)) MM YYYY'));

    Insert test values (3, 'DS1982', TO_DATE ('01.05.2014 ',' DD.)) MM YYYY'));

    Insert test values (4, 'DS1982', TO_DATE ('01.06.2014 ',' DD.)) MM YYYY'));

    Insert test values (1, 'DS1999', TO_DATE ('11.04.2014 ',' DD.)) MM YYYY'));

    Insert test values (2, 'DS1999', TO_DATE ('11.05.2014 ',' DD.)) MM YYYY'));

    Insert test values (3, 'DS1999', TO_DATE ('11.06.2014 ',' DD.)) MM YYYY'));

    Insert test values (4, 'DS1999', TO_DATE ('11.07.2014 ',' DD.)) MM YYYY'));

    Insert test values (1, 'DS0009', TO_DATE ('21.01.2014 ',' DD.)) MM YYYY'));

    Insert test values (2, 'DS0009', TO_DATE ('21.02.2014 ',' DD.)) MM YYYY'));

    Insert test values (3, 'DS0009', TO_DATE ('21.03.2014 ',' DD.)) MM YYYY'));

    {code}

    I have to query all records from the table that has:

    Max (start_date) whitin ID and DS culoms.

    So, I have to insert in the record in the table for each DS to condition:

    Each record will be inserted with incremented id whithin DS

    each record inserted must be "newer" than previous 1 month.

    Integration goes up to to_char (sysdate, mm) = to_char (start_date, 'mm').

    Resoult for DS1982 has so (records to insert):

    Insert test values (5, 'DS1982', TO_DATE ('01.07.2014 ',' DD.)) MM YYYY'));

    Insert test values (6, 'DS1982', TO_DATE ('01.08.2014 ',' DD.)) MM YYYY'));

    Insert test values (7, 'DS1982', TO_DATE ('01.09.2014 ',' DD.)) MM YYYY'));

    Insert test values (8, 'DS1982', TO_DATE ('01.10.2014 ',' DD.)) MM YYYY'));

    Insert test values (9, 'DS1982', TO_DATE ('01.11.2014 ',' DD.)) MM YYYY'));

    Insert test values (10, 'DS1982', TO_DATE ('01.12.2014 ',' DD.)) MM YYYY'));

    Insert test values (11, 'DS1982', TO_DATE ('01.01.2015 ',' DD.)) MM YYYY'));

    Insert test values (12, 'DS1982', TO_DATE ('01.02.2015 ',' DD.)) MM YYYY'));

    Insert test values (13, 'DS1982', TO_DATE ('01.03.2015 ',' DD.)) MM YYYY'));

    Insert test values (14, 'DS1982', TO_DATE ('01.04.2015 ',' DD.)) MM YYYY'));

    all together for DS1982

    Insert test values (1, 'DS1982', TO_DATE ('01.03.2014 ',' DD.)) MM YYYY'));

    Insert test values (2, 'DS1982', TO_DATE ('01.04.2014 ',' DD.)) MM YYYY'));

    Insert test values (3, 'DS1982', TO_DATE ('01.05.2014 ',' DD.)) MM YYYY'));

    Insert test values (4, 'DS1982', TO_DATE ('01.06.2014 ',' DD.)) MM YYYY'));

    Insert test values (5, 'DS1982', TO_DATE ('01.07.2014 ',' DD.)) MM YYYY'));

    Insert test values (6, 'DS1982', TO_DATE ('01.08.2014 ',' DD.)) MM YYYY'));

    Insert test values (7, 'DS1982', TO_DATE ('01.09.2014 ',' DD.)) MM YYYY'));

    Insert test values (8, 'DS1982', TO_DATE ('01.10.2014 ',' DD.)) MM YYYY'));

    Insert test values (9, 'DS1982', TO_DATE ('01.11.2014 ',' DD.)) MM YYYY'));

    Insert test values (10, 'DS1982', TO_DATE ('01.12.2014 ',' DD.)) MM YYYY'));

    Insert test values (11, 'DS1982', TO_DATE ('01.01.2015 ',' DD.)) MM YYYY'));

    Insert test values (12, 'DS1982', TO_DATE ('01.02.2015 ',' DD.)) MM YYYY'));

    Insert test values (13, 'DS1982', TO_DATE ('01.03.2015 ',' DD.)) MM YYYY'));

    Insert test values (14, 'DS1982', TO_DATE ('01.04.2015 ',' DD.)) MM YYYY'));

    I hope someone can help me with this problem!

    Thank you!

    This...

    SELECT the id + id LEVEL,

    DS,

    Start_date ADD_MONTHS (start_date, Level)

    Of

    (SELECT ds,

    Max (ID) id,

    Date_début Max (start_date)

    OF the test

    GROUP BY ds)

    CONNECT BY LEVEL<=>

    AND PREREQUISITES ds = ds

    AND PRIOR DBMS_RANDOM. VALUE IS NOT NULL.

    Thank you

    Ann

  • Is it possible to change the State through several buttons?

    If I have already created, say, 100 identical buttons, and I want to change the State 'down' to a new color other than black. is it possible to do it quickly? I use 9 Captivate.

    Because you talked about "buttons" I assumed that you were pointing to the InBuilt States: Normal, rollover and down. The situation with styles is a little confusing IMO concerning States. You cannot set the States in Manager of Style of the object, as was the case of the Captivate 8 buttons. Since 9 Captivate, you will need to define States in the Panel object, for custom reports also state in regard to integrated States. Part of the InBuilt says are really integrated in the style: this is the case for all of the State for the Image buttons, for the background/outline for other types and form buttons. The labels on the buttons (text, system and form) are not part of the style. The exception are the image buttons because you have to put the text in the images. If you add objects in integrated States, they wil not be part of the style.  Even for States custom: they are not part of the style. I have problems with this configuration of confusing. It would be much easier, I think, if everything was recorded in an object style could be edited and changed in the Object styles Manager.

    The button menu "three lines", also called the hamburger or hot dog button, has opportunities to save changes to an existing style, to create a new style to apply a style to objects with a different style by default (as long as you override, leading + sign to appear).

    This no doubt confused answer: the workflow, I proposed with object styles, does that for characteristics that are saved in an object style (there no real explanation to help him as far as I KNOW). Now, I understand your last answer (sorry) that you are talking about a State that isn't integrated, but custom. In this case, you cannot change this State for all buttons at the same time. Only way is to duplicate the buttons. My apologies, I may have to write a blog about the object styles and its Director. I've heard several trainers proclaiming that they never use the OSM.

  • I need to change our address IP VirtualCenter

    We are currently under going a revamp of our IP addressing scheme.

    The server is currently at 192.168.199.180. I need to change this IP address to 10.110.187.180. The ESX hosts themselves will not change their IP addresses.

    I tried to simply change the IP address to the Virtual Center Server, but that did not work. I lost any communication to our cluster and ESX farm.  I don't know if it's just because I did not have enough time for the ESX servers look at the updates to the DNS server or what. I'm fairly certain that most of the configuration should be using DNS. Y at - it everywhere especially in Virtual Center I should look to see if there are IP addresses hard?

    Thank you!

    See the bottom of this KB, http://kb.vmware.com/kb/5850444 , it may be useful

  • Need to change the generated text automatically report pdf

    I implemented the pdf but it generated text from xml autogenrated.

    If I need to change this text then what should I do for this?


    Here's my xsl file and the output generated in pdf format.

    <? XML version = "1.0" encoding = "UTF-8"? >
    < xsl: stylesheet version = "1.0" xmlns: xsl = "http://www.w3.org/1999/XSL/Transform".
    xmlns:fo = "http://www.w3.org/1999/XSL/Format".
    xmlns:fn = "http://www.w3.org/2005/xpath-functions" >

    < xsl: output method = "xml" Indent = "Yes" encoding = "utf-8" omit-xml-declaration = "yes" / >




    < xsl: template match = "/" >

    < fo:root >

    < fo:layout - master-set >
    < fo:simple - page-master master-name = "my page" >
    < fo:region - body margin = "in 1" / >
    < fo:region - before measure = 'in 1' background-color = "silver" / >

    < / fo:simple - page-master >
    < / fo:layout - master-set >

    < fo:page - master-reference sequence = "my page" >


    < fo:static - content stream name = "xsl-region-before" >
    < fo:block height = "150px" width = "1024px" background-color = 'blue' >
    < fo: external-graphic width = "340px" src = "http://localhost:9000/web-determinations9000/images/logo.png"/ > "

    < / fo:block >
    < / fo:static - content >



    < fo:flow = "xsl-region-body" flow-name >

    < fo:block >
    < xsl: mode if apply-templates = sΘlectionner 'dump' = ' / session, entity, instance, attribute "/ >
    < / fo:block >
    < / fo:flow >
    < / fo:page - sequence >
    < / fo:root >
    < / xsl: template >


    pdf output-

    What is the student card? =
    65.0
    Is scored more than 80% % = true
    true
    What is the name of the student? =
    ASF
    What is lastname? =
    ASDF
    Student is eligible for the gold medal? =
    true


    If I want to "is the student card?" the text-only student Id then what changes I need to do this?

    Hello

    Here is the sample code for your understanding:

    
    
    
    
    
    
    
    
    
         
              
              
         
    
    
    
         
              
              
              
         
    
         
              
              
              
         
    
    
    
    
    
         
              Student ID:
         
    
    
    
    

    Thank you
    Aakarsh

  • Hello, I need help.  in photoshop / editing / color / color / RGB management rules, it is impossible to change this point. Is in the "off" position and I would choose "preserve embedded profiles' I'm on windows 8 and creative cloud for photoshop.

    Hello, I need help. in photoshop / editing / color / color / RGB management rules, it is impossible to change this point. Is in the "off" position and I would choose "preserve embedded profiles' I'm on windows 8 and creative cloud for photoshop.

    Policies automatically goes to "off" If you have your screen as working RGB profile - what is something that you should never do. Always have a standard space like RGB work.

    And Yes, "preserve embedded profiles" is the only sensitive parameter. Others are best for special purposes where you really know what you are doing - at worst they will transform your archive in a unrecoverable mess.

  • My set-up agency &amp; ABC developed for us. We no longer use the Agency. I have 2 log-in - but 1) cannot change my billing settings &amp; 2) cannot update models due to lack of access. Need help to change this.

    My set-up agency & ABC developed for us. We no longer use the Agency. I have 2 log-ins - but 1) cannot change my billing settings & 2) cannot update models due to lack of access. Need help to change this.

    Hi Rebecca,.

    You should get in touch with our accounts team to work a solution to your problem. Drop them a note at: contact us | Adobe Business Catalyst

    Cristinel

  • Hi team! I would like to change my payment information, but I can't. I need to change the address of the United States to the Russia. my VISA card also has a Russian address. Thank you! Best!

    Hi team! I would like to change my payment information, but I can't. I need to change the address of the United States to the Russia. my VISA card also has a Russian address.  Thank you! Best!

    You must contact the technical support for this.

    To the link below, click on the still need help? option in the blue box below and choose the option to chat or by phone...

    Make sure that you are logged on the Adobe site, having cookies enabled, clearing your cookie cache.  If he continues to not try to use a different browser.

    https://helpx.Adobe.com/contact.html?step=ZNA_account-payment-orders_stillNeedHelp

    Concerning

    Stéphane

  • Need to change my iPad in the United States to the United Kingdom as now living in the United Kingdom. Can not change the address or buy in the store.

    Need to change my address in the United Kingdom, the United States, now retired to the United Kingdom and does not apply to make the address change or buy on the Apple Store of UK or download new applications.

    Settings > general > language and region > region > United Kingdom

    I believe that this change will allow you to do what you need to do!

Maybe you are looking for

  • Apple Watch Group compatibility

    Hello world I have a Apple Watch Sport 38mm (1st gen). I was about to buy series 2 Apple Watch soon and I was wondering if my old Apple Watch Sport bands would be compatible with my new Apple Watch series 2? If anyone can let me know I would apprecia

  • Removal of administrator rights

    Hello If I delete my account Admin rights after you create another admin account, in order to continue to use my ex-admin account now for everyday tasks, will I have problems? So, to summarize: (1) create an admin account for changes in the system et

  • Remote Start / Stop function

    I was wondering if Peter has any information about a remote starter / stop feature. How can I connect start function of my C-motion or Preston the camera remotely? I don't see any other than the 'Remote' normal connection points, but this only works

  • hp15ac122tu: driver problem

    I installed windows 8.1 64 bit in my hp15ac122tu. But I can't find the drivers for my laptop. Plez help. As I can't do some work correctly.

  • BlackBerry Smartphones Protect BB - reset lock

    I experimented by locking my handset via internet using the BB to Protect function do (just to see how it works).  My device now makes me every now and then enter the specified password. Is there a way to get rid of him now?