Problem in using sum with distinct in case

Hi all,
I want to use a sum function with distinct and also with case.
below is the format i am using.
Sum( distinct case when a.value='TOOL' then e.value else 0 end)
This is working but i don't get distinct records.
SO i tried using in this way
Sum( case when a.value='TOOL' then distinct e.value else 0 end)
But I am getting missing expression error.
Please help me to resolve this issue
Thanks
Priya

STEP -2
SQL>
SQL> commit;
Commit complete.
SQL> ed
Wrote file afiedt.buf
  1  Select Sum(Value)
  2  From (
  3          Select Distinct Case when value='TOOL'
  4                               then value
  5                          else
  6                              0
  7                          end Value
  8          From Blah
  9*      )
SQL> /
                            0
ERROR at line 6:
ORA-00932: inconsistent datatypes: expected CHAR got NUMBERRegards.
Satyaki De.

Similar Messages

  • Navigation problem when using tiles with JSF

    Hi all,
    I m using tiles with JSF. i have included all the libraries and jsp page is rendered properly. but when i use <h:commandLink> in the body part of the JSP , i cannot go to the specified link. when we use tiles, what changes need to be done in faces-config file?? i mean what navigation rule we need to specify ??

    Hello, I have the same problem; JSF+Tiles = No navigation.
    One basic question is should I reference the parent jsp or the included body jsp in the faces-config.xml file.
    For example: The login.jsp is a main tiles page that includes a menu.jsp, header.jsp & a loginBody.jsp.
    Hence the faces-config could have this rule;
    <navigation-rule>
    <from-view-id>/login.jsp</from-view-id>
    <navigation-case>
    <to-view-id>/catalog.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    (I've left the outcome tag out to simplify this post)
    Or, I could refer loginBody.jsp in the navigation rule;
    <navigation-rule>
    <from-view-id>/loginBody.jsp</from-view-id>
    <navigation-case>
    <to-view-id>/catalog.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    The loginBody.jsp has a commandbutton which a user clicks which starts the navigation.
    Neither seems to work unfortunately & I'm a stuck.
    Thanks

  • Problem while using XML with Oracle

    I have a problem using XML with oracle applications
    The process I am following
    1. Making a XML string.
    2. Parsing it to get a document
    3. Free the parser using xmlparser.freeparser
    4. Traversing through nodes .
    5. Freeing the document.
    The whole Process is executed in batch mode.
    The problem occurs after executing the procedure for 5000 records and I get the error
    ORA-04031: unable to allocate 4176 bytes of shared memory ("shared pool","unknown object","sga
    heap","library cache")
    Can you please help me out to overcome this problem
    It's urgent
    I have
    Oracle version 8.1.7.0.0
    XML version 1.2
    OS Windows NT
    To resolve the problem I have increase shared memory size and java initialization parameters ,which seems OK
    Looking forward for your answer.

    Hello, Reena
    Your process flow seems to be correct in term of getting/freeing memory.
    Following error
    The problem occurs after executing the procedure for 5000 records and I get the error
    ORA-04031: unable to allocate 4176 bytes of shared memory ("shared pool","unknown object","sga
    heap","library cache")may be caused by memory leaks in xdk or memory fragmentation(due to get/free memory cycle)
    To find out if this is an memory leak issue you could try to monitor V$SGASTAT from one session while running your batch process in another session.
    To prevent (or lower its impact) fragmentation issues try to PIN objects, and adjust java_pool_size and shared_pool_reserved_size.
    Anyway, counsult your Oracle DBA.
    Oracle version 8.1.7.0.0I think, you should apply database patch first of all. The latest one (8.1.7.4.x) could be accured from Metalink.

  • Problems tethering using wifi with Twist laptop and iphone

    Hello,
    I have a Twist and works fine, although I have recently moved to an iphone 6.  The phone and laptop combination has problem tethering over wifi, with tethering enabled on the phone, the laptop does not find the wifi signal.  Asking a colleague to see if my phone is broadcasting an SSID, which it was.  The laptop just doesn't want to find my iphone wifi signal.  However, finding any wifi broadcast from a router, it finds it first time!
    Since it was a new phone, I have been speaking with apple a lot and have even replaced the iphone, although problems still persist.
    I am starting to think it is the lenovo twist laptop.  I have checked the drivers and I have the latest ones which are on the lenovo website because the program used to update the software doesn't ask me to install a new driver, but looking at the wifi driver within the device manager it is dated: 13/08/2012. with driver version #: 6.20.55.55.
    I have the 2x2 11a/b/g/n Wireless LAN PCI Express Half Mini Card Adapter and is based on the Broadcom chipset.
    Do any of you have this problem?  Also, where can I obtain the very latest driver for this as I would suspect it is likely to be a driver issue or I would like to rule this out first.
    Many thanks.
    Solved!
    Go to Solution.

    Thanks for the progress report.
    If things remaIn stable, please do come back and mark you post as the solution. It may help other members.
    Thanks.
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество
    Community Resources: Participation Rules • Images in posts • Search (Advanced) • Private Messaging
    PM requests for individual support are not answered. If a post solves your issue, please mark it so.
    X1C3 Helix X220 X301 X200T T61p T60p Y3P • T520 T420 T510 T400 R400 T61 Y2P Y13
    I am not a Lenovo employee.

  • Problems in using Msync with  IPAQ 3760 and Active SYnc 3.5

    Hi,
    Environment :-
    IPAQ 3760
    Windows NT workstation
    Active Sync 3.5
    I am using Active Sync 3.5 which does not need RAS
    configuration on the machine.
    I am unable to run msync.exe. It does not give any errors
    messages.
    The 9i lite documentation talks about RAS settings.
    If anyone has faced similar prob coudl you please let me know
    the solution.
    regards,
    Sonal

    You do not need to make a RAS connection with Pocket PC 2002,
    because now ActiveSync itself makes an IP connection, and
    Oracle9i Lite just needs an IP connection for synchronization no
    matter how you establish it. Hi, I also experience the same problem. Using PocketPC 2002 I have a pasthru connection. Ik kan browse on the Internet with Internet Explorer, so the connections works.
    mSync just seems to do nothing. When I press the Sync button, nothing happens (not even a progress bar).
    Any idea?
    Thanks,
    Bas.

  • Problem in using FilenameFilter with FileDialog

    perhaps, i dont know how to use FilenameFilter with FileDialog because the following approach doesn' work
    FileDialog fd=new FileDialog(myframe,"Select an image");
    fd.setFilenameFilter(new filefilter());                                                                                                                           
                                                                                                             class filefilter implements FilenameFilter{
        public boolean accept(File dir, String name) {
            if(name.endsWith("jpg")||name.endsWith("gif")||name.endsWith("png")){
                          return true; 
                 return false;
    }if anyone have compatible idea then please let me know.
    thanks

    Did you print out the value of "dir" and "name" to make sure they contain what you expect?
    If you need further help then you need to create a "Short, Self Contained, Compilable and Executable, Example Program (SSCCE)", that demonstrates the incorrect behaviour.
    http://homepage1.nifty.com/algafield/sscce.html

  • How can I use WM_CONCAT with DISTINCT in a stored provedure?

    Hi,
    I join three tables. For example one is for employees, other is for employee address, and the last one is for the cities of employees that work. I want to take the employee id, address city, and working cities. It is like the table below, but I want one line for each employee, so I used WM_CONCAT. Because there is duplicate data, I used DISTINCT in WM_CONCAT. It works fine normally, but if I want to use it in a stored procedure it gives an error :ORA-30482: DISTINCT option not allowed for this function. Is there anyone who could solve this problem? Thank in advance.
    EXP_ID CITY_ADDRESS CITY_WORK
    1     IZMIR      IZMIR
    2     IZMIR     DENIZLI
    2     IZMIR     IZMIR
    2     IZMIR     IZMIR
    Edited by: 878596 on 10.Ağu.2011 22:48

    WM_CONCAT is an undocumented function. It is used only for Oracle Internal Purpose. You are not supposed to use it. Never use any Undocumented feature of Oracle. That could get you into trouble.
    Said that if you can tell us exactly what problem are you trying to solve with WM_CONCATE we could give you a better solution without using WM_CONCATE.
    Please read the Link How to ask a question in this forum? To post the question in a proper way.
    SQL and PL/SQL FAQ

  • Problem in Using Log4J with Weblogic 9.2

    I am using Weblogic 9.2 and Log4j.
    By using Admin console I set the Severity Level to WARNING and inside my java code is given below:
    Logger logger = Log4jLoggingHelper.getLog4jServerLogger();
    if (logger.isEnabledFor(Priority.DEBUG)){
    logger.debug("DEBUG - Test Debug message");
    logger.info("DEBUG - Test Info Message");
    logger.warn("DEBUG - Test Warning Message");
    logger.error("DEBUG - Test Error Message");
    logger.fatal("DEBUG - Test Fatal Message");          
    Somehow the logger.isEnabledFor(Priority.DEBUG) returning 'TRUE' and the follwoing message is displayed.
    <Nov 29, 2006 2:44:04 PM EST> <Warning> org.apache.log4j.Category> <000000> <DEBUG - Test Warning Message>
    <Nov 29, 2006 2:44:04 PM EST> <Error> <org.apache.log4j.Category> <000000> <DEBUG - Test Error Message>
    <Nov 29, 2006 2:44:04 PM EST> <Info> <org.apache.log4j.Category> <000000> <DEBUG - Test Fatal Message>
    <b><i>NOTE - The logger.debug() and logger.info() methods are not invoked because of the severity level to 'WARNING' in the console.</i></b>
    <b>I would like to know why the Somehow the logger.isEnabledFor(Priority.DEBUG) is having a value of 'TRUE'.</b>
    I expected only the Somehow the logger.isEnabledFor(Priority.ERROR) will have the value of 'TRUE'.

    Did you get an answer to your question? I have the same problem with WebLogic 10.0.

  • Problem in using createStatement with parameters

    Hi,
    I have a peculiar problem using JDBC-ODBC bridge driver. With this driver I am able to make a connection to the database (Oracle/SQL Server/MS-Access). But when I try to create a statement using the connection, I get an error. The code written by me is below :-
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn = DriverManager.getConnection("jdbc:odbc:tsvt","sa","");
    Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    If I use this constructor fo createStament, I get the following Runtime Exception
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Optional feature not implemented
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Optional feature not implemented
         at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6031)
         at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6188)
         at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:2494)
         at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:314)
         at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(JdbcOdbcStatement.java:229)
         at accs2oracl.<init>(accs2oracl.java:39)
         at accs2oracl.main(accs2oracl.java:166)
    If I use just conn.createStatement(), I dont get any error.
    Some one help me out where I am going wrong

    Some - or most? - ODBC driver, especially MS for SQLServer and Access, don't support these advanced JDBC features.
    Like the messages says: they are optional features, and the driver doesn't implement them.
    A good news:
    you don't need them.
    Just go through your ResultSets only forward by next(), and do all inserts, updates and deletes with executeUpdate() and SQL commands.

  • Problem in using 6670 with T-Mobile.. need urgent ...

    hiya there
    ive got a strange problem with my 6670
    the problem is specifically with using T-Mobile uk
    when i put my T-Mobile sim in the phone i can make phone calls and recieve txts but it just only recieve phone calls from the same network i.e T-Mobile not from even landline the message ppl get is "the phone is currently unavailable" it dont even go to the voice mail.
    on the other hand if i put my orange sim the phone work totally normal i can make calls and i can recieve calls from any network or landlines.
    i have tried alot of ppl even car phone warehouse but they said they will charge 100£ which i cant afford
    so if somebody can help me out in this situation
    ill be grateful
    cheers
    chekoo

    Since you said it works fine with an Orange SIM card, it sounds more like it's a network issue than a handset issue. I'd give T-Mobile a call and see what they can do for you - Your SIM may have call barring setup.
    Aubs
    Aubs

  • NIO: Strange problem when using ByteBuffer with non-blocking SocketChannel

    Hi,
    I have a server that uses multiplexed, non-blocking I/O with java.nio. When a client connects, the server waits for the message: <system cmd="knock"/>, returns a message and disconnects the client. The clients are shortly serviced in less than a second.
    But the server newer receive anything from about 20% of the clients - even though it is sent. Or with other words: it is received and the data is contained in the ByteBuffer - SocketChannel.read(ByteBuffer) - but a call to ByteBuffer.remaing() returns 0 !!
    ByteBuffer receiveBuf = ByteBuffer.allocate(65536);
    receiveBuf.clear(); // the code is elsewhere used for longer living clients
    int readBytes = channel.read(receiveBuf);
    receiveBuf.flip();
    StringBuffer sb = new StringBuffer();
    System.out.println(" * Remaining: "+receiveBuf.remaining()); // writes: ' * Remaining: 0'
    System.out.println(" * Received: "+new String(receiveBuf.array())); // writes: ' * Received: <system cmd="knock"/>'
    while(receiveBuf.remaining() >= 2) {
      byte b = receiveBuf.get();
      sb.append((char)b);
    System.out.println(" * sb content: "+sb.toString()); // writes: ' * sb content: 'The ByteBuffer clearly receives the correct data, but the ByteBuffer.remaining() returns 0 and therefore the StringBuffer will never have any content.
    The problem seems to occur randomly and for about 20% of the clients (simulated from the same computer and therefore has the same bandwidth and so on).
    Anyone knows what is going on, and how to solve the problem !?

    It's always possible in any read that the number of bytes read is less than the number of bytes requested. You need to keep reading until you have got everything you expected, and cope with every possible error condition on each iteration.
    EJP

  • MacBook Pro (r) noise problem when using headphones with 90%+ charge?

    I've tried using other headphones on the MacBook and they work just fine; but I've also used the Denons on other devices and they too work perfectly fine. The problem is that the headphones output has too much bass, if that makes sense. It's the same as when you play a very very loud noise on a tiny speaker. I've tried playing on the settings but nothing works! I bought the laptop 2 weeks ago and the problem persisted even then but I didn't think of it as a big problem until now. I'm 100% sure the problem only exists when the charge is 90% or higher because I saw the charge drop to 89% and *poof*! it goes back to normal! This is really very annoying!

    You are still under warranty.  Call Apple Care. Make sure you get a case number as all repairs have an additional 90 days of warranty. 
    Take FULL advantage of your warranty.  Posting on a message board should be done as a last resort and if you are out of warranty or Apple Care has expired.

  • Problem in Using  Oracle with Thin Clients(Image) Technology

    I am running Oracle on Server and mine clients are thin clients.I have image on Oracle Server from where I am booting thin clients.The Problem I am facing is when I use single Thin client then everything works but as I starts using more than one thin client mine I got the error rwrun60 and it gives the that close or ignore message.I am using run_product for running reports.Then I tried to use run_report_object but how can I pass paramater using run_report_objects

    i m not getting much from what you are saying.... but i found something.i created a windows application and then was able to create a dataset from ODAC connection to oracle. then dragging the dataset on windows form... i was able to create a data grid containing the data. hittin F5 the app was running successfull. however when tryin to do same in asp.net...when configuring the data source using sql datasource it gave me following error ...
    ORA-00942: table or view does not exist
    help help

  • Problem in using DOMAdapter with xslt

    I have created one .xslt file for transforming one XML to another XML. I am using api's like xerces-2_7_1,xalan-j_2_7_1 from Apache.
    In side my xslt I have taken variable(for sample) like:
    <xsl:variable name="MyVar">
      <Nodes>
        <Node>
          <xsl:attribute name="type">TypeOne</xsl:attribute>
          <Value>This is first node.</Value>
         </Node>
         <Node>
           <xsl:attribute name="type">TypeTwo</xsl:attribute>
           <Value>This is second node.</Value>
         </Node>
         <Node>
           <xsl:attribute name="type">TypeThree</xsl:attribute>
           <Value>This is Third node.</Value>
         </Node>
      </Nodes>
    </xsl:variable>
    <xsl:for-each select="myextension:testMethod ($MyVar)">
         <!-- My Code on selected object.-->
    </xsl:for-each>I want to access this variable in my XSLTExtension class which is a simple java class. I have called method of this class with select="myextension:testMethod ($MyVar)" above.
    I am getting variable in XSLTExtension file and even got all values of it.
    I written code in java file like:
    import com.sun.org.apache.xalan.internal.xsltc.dom.DOMAdapter;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    public static DOMAdapter testMethod (Object adapter){
            DOMAdapter domAdapter = (DOMAdapter) adapter;
            Node nodes = domAdapter.makeNode (domAdapter.getIterator ());
            NodeList list = nodes.getChildNodes ();
                   Code for getting values form NodeList which is quite simple.
                   Processing those values with my business logic and
                   creating new Document to be returned as DOMAdapter.
    }As I mentioned in method I want to return DOMAdapter from method to calling XSLT file. How can I do this?
    if any one have any Idea then please tell me. Any comment regarding this will help me.
    Thanks in Advance,
    TYPurohit.

    Since you said it works fine with an Orange SIM card, it sounds more like it's a network issue than a handset issue. I'd give T-Mobile a call and see what they can do for you - Your SIM may have call barring setup.
    Aubs
    Aubs

  • Error when trying to use SUM with COUNT

    I have the following query which works fine. However, I need to add another column that is the SUM of the firs column ("OPEN"). I have also included that query but I cannot get it to work. Any help would be appreciated.
    SELECT
    TO_CHAR(TRUNC(R.RAD_SUBMIT_DATE, 'MM'), 'yyyy-mm') as THISDATE,
    COUNT(decode(A.STATE_DESC, 'Approved', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Concept', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'New', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Pending', A.STATE_DESC))
    ) as OPEN,
    COUNT(decode(A.STATE_DESC, 'Approved', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Concept', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'New', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Pending', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Completed', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Rejected', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Rescinded', A.STATE_DESC))
    ) as TOTAL
    FROM RAW_APP_DATA R, APP_STATE A
    WHERE R.RAD_STATUS = A.STATE_ID
    AND (R.RAD_SUBMIT_DATE BETWEEN '01-AUG-02' AND '31-JAN-04')
    GROUP BY TO_CHAR(TRUNC(R.RAD_SUBMIT_DATE, 'MM'), 'yyyy-mm')
    ORDER BY TO_CHAR(TRUNC(R.RAD_SUBMIT_DATE, 'MM'), 'yyyy-mm')
    (RESULTS)
    THISDAT OPEN TOTAL
    2002-08 1 37
    2002-09 0 40
    2002-10 0 33
    2002-11 1 25
    2002-12 2 22
    2003-01 3 25
    2003-02 4 101
    2003-03 5 99
    2003-04 5 85
    2003-05 3 69
    2003-06 17 90
    2003-07 6 57
    2003-08 26 89
    2003-09 43 117
    2003-10 59 110
    2003-11 47 67
    2003-12 75 80
    2004-01 9 9
    18 rows selected.
    SECOND QUERY (DOES NOT WORK)
    SELECT
    TO_CHAR(TRUNC(R.RAD_SUBMIT_DATE, 'MM'), 'yyyy-mm') as THISDATE,
    COUNT(decode(A.STATE_DESC, 'Approved', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Concept', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'New', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Pending', A.STATE_DESC))
    ) as OPEN,
    COUNT(decode(A.STATE_DESC, 'Approved', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Concept', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'New', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Pending', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Completed', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Rejected', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Rescinded', A.STATE_DESC))
    ) as TOTAL,
    SUM(
    COUNT(decode(A.STATE_DESC, 'Approved', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Concept', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'New', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Pending', A.STATE_DESC))
    )) as "OPEN TOTAL"
    FROM RAW_APP_DATA R, APP_STATE A
    WHERE R.RAD_STATUS = A.STATE_ID
    AND (R.RAD_SUBMIT_DATE BETWEEN '01-AUG-02' AND '31-JAN-04')
    GROUP BY TO_CHAR(TRUNC(R.RAD_SUBMIT_DATE, 'MM'), 'yyyy-mm')
    ORDER BY TO_CHAR(TRUNC(R.RAD_SUBMIT_DATE, 'MM'), 'yyyy-mm')
    DESIRED RESULT SET
    THISDAT OPEN TOTAL TOTAL OPEN
    2002-08 1 37 1
    2002-09 0 40 1
    2002-10 0 33 1
    2002-11 1 25 2
    2002-12 2 22 4
    2003-01 3 25 7
    2003-02 4 101 11
    2003-03 5 99 16
    2003-04 5 85 21

    You are right those are group functions not aggregate. However, if I try to group by with the group functions I get an error (see code).
    SELECT
    TO_CHAR(TRUNC(R.RAD_SUBMIT_DATE, 'MM'), 'yyyy-mm') as THISDATE,
    COUNT(decode(A.STATE_DESC, 'Approved', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Concept', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'New', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Pending', A.STATE_DESC))
    ) as OPEN,
    COUNT(decode(A.STATE_DESC, 'Approved', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Concept', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'New', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Pending', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Completed', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Rejected', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Rescinded', A.STATE_DESC))
    ) as TOTAL,
    SUM(
    COUNT(decode(A.STATE_DESC, 'Approved', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Concept', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'New', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Pending', A.STATE_DESC))
    )) as "OPEN TOTAL"
    FROM RAW_APP_DATA R, APP_STATE A
    WHERE R.RAD_STATUS = A.STATE_ID
    AND (R.RAD_SUBMIT_DATE BETWEEN '01-AUG-02' AND '31-JAN-04')
    GROUP BY
    TO_CHAR(TRUNC(R.RAD_SUBMIT_DATE, 'MM'), 'yyyy-mm'),
    COUNT(decode(A.STATE_DESC, 'Approved', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Concept', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'New', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Pending', A.STATE_DESC))
    COUNT(decode(A.STATE_DESC, 'Approved', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Concept', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'New', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Pending', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Completed', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Rejected', A.STATE_DESC)) +
    COUNT(decode(A.STATE_DESC, 'Rescinded', A.STATE_DESC))
    ORDER BY TO_CHAR(TRUNC(R.RAD_SUBMIT_DATE, 'MM'), 'yyyy-mm')
    ORA-00934: group function is not allowed here
    Do I group by the columns individually?

Maybe you are looking for

  • Unable to start ORACLE 8.1.5 on RedHat 6.2

    completed installation of Oracle 8.1.5 on Redhat 6.2. dbassist reports that it had created a database for me. But I am unable to "STARTUP" the oracle instance successfully. I get "Load Indicator not supported by OS" message in the "alert" log. null

  • Syncing 2 iPhones to same Macbook pro

    I have a Macbook pro running OSX (10.6.8) and both my wife and I have iPhones (3 and 4). Is there a way to sync both to iTunes and keep the data separate (we both have different contact lists, etc.)?

  • Re-Process failed XI Messages Automatically

    If there is any other blog other than 2728 that talks about how to re-process XI Messages? On What Cirumstances we need to Reprocess a Message?

  • Putting albums in order

    How come when I put new music on my ipod it doesn't always put it in alphabetical order? For instance I put Jimmy Buffett on there which is a two disc album. It put disc 1 where it should be but disc 2 is at the end. I have outkast albums mixed up al

  • Hi , do we have any app for recharge iPad sim ?

    I want to recharge my iPad sim ... How do I do ? Does we have app for do that ?