not an expression GROUP BY - bug in Oracle 10 g?

Hello
I'm 00979. 00000 - "not a GROUP BY expression" error on Oracle 10g 10.2.0.4.0 - Production 64-bit.

To illustrate my problem, I have created following the example.
Think I have a shop with clothes. Whenever I sell something, I store this information in the database - storage in real time, type of clothing (pants, socks,...) and the size of the room (M, L, XL,...).
Now, the system account statistics every hour. So he's going thru the table with parts sold and counts the number of pieces by clothing type and size from the start of the day. It is important to realize that it is since the beginning of the day. For this reason, the number of pieces sold in the statistical table grows every hour (or is at least on the same value as in the previous hour).

Now, this table, I need to make new statistics. I want a statistic how many pieces by size, I sold every hour.
I created this application for this:
SELECT TIME, xSIZE, (SOLD  - NVL((SELECT SUM(S1.SOLD)
                                  FROM STATISTICS S1
                                  WHERE S1.xSIZE = S.xSIZE
                                    AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME
                                    AND TO_CHAR(S1.TIME, 'HH24') != '23'
                                    AND S1.xSIZE IS NOT NULL
                                  GROUP BY TRUNC(S1.TIME, 'HH24'), S1.xSIZE),0)) SOLD
FROM(


SELECT TRUNC(S.TIME, 'HH24') TIME, S.xSIZE, SUM(S.SOLD) SOLD
FROM STATISTICS S
WHERE S.xSIZE IS NOT NULL
GROUP BY TRUNC(S.TIME, 'HH24'), S.xSIZE
--ORDER BY 1 DESC
) S
ORDER BY TIME DESC, xSIZE ASC
First I select the number of pieces sold by time and by size. To get the number of pieces sold for specific time, I need to subtract the value of number of pieces sold of the previous hour. I decided to do it with a parameter query.
Runs the query like this I don't get "a GROUP BY expression" error. However, if I Uncomment 'ORDER BY DESC of 1' statement, the query works. I'm sure that he must do something with this line:
AND TRUNC (S1. TIME, 'HH24') + 1/24 = S.TIME

If you change the query like this:
SELECT TIME, xSIZE, (SOLD  - NVL((SELECT SUM(S1.SOLD)
                                  FROM STATISTICS S1
                                  WHERE S1.xSIZE = S.xSIZE
                                    --AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME
                                    AND TO_CHAR(S1.TIME, 'HH24') != '23'
                                    AND S1.xSIZE IS NOT NULL
                                  GROUP BY  S1.xSIZE),0)) SOLD
FROM(

SELECT TRUNC(S.TIME, 'HH24') TIME, S.xSIZE, SUM(S.SOLD) SOLD
FROM STATISTICS S
WHERE S.xSIZE IS NOT NULL
GROUP BY TRUNC(S.TIME, 'HH24'), S.xSIZE
--ORDER BY 1 DESC
) S
ORDER BY TIME DESC, xSIZE ASC
Join the removed occasionally truncated tables and grouping truncated at the time--> the query does not lack...
And now the best... If you run the first query on Oracle 11 g (11.1.0.6.0 - 64 bit Production version), it works.
Anyone know why the first query does not work on 10g? Are there bugs and limitations for this version of server?
Please don't tell me to rewrite the query in a different way, I already did, to make it work on 10g more. I'm just curious as to why it does not work on 10g.

Finally, here are some data for the test.
CREATE TABLE STATISTICS(
  TIME DATE DEFAULT SYSDATE,
  TYPE VARCHAR2(20),
  xSIZE VARCHAR2(2),
  SOLD NUMBER(5,0) DEFAULT 0
)


INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'T-Shirt', 'M', 10);
INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'Socks', 'M', 3);
INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'T-Shirt', 'L', 1);
INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'Socks', 'L', 50);
INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'Trousers', 'XL', 7);
INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'Socks', 'XL', 3);


INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 1/24, 'T-Shirt', 'M', 13);
INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 1/24, 'Socks', 'L', 60);
INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 1/24, 'Trousers', 'XL', 15);
INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 1/24, 'Socks', 'XL', 6);
Edited by: user12047225 the 20.9.2011 23:12

Edited by: user12047225 the 20.9.2011 23:45

This is a known issue when the optimizer decides to expand the online display. You can add something (outside of ORDER BY you already used) in online mode to prevent the optimizer from its expansion. For example:

SQL> SELECT  TIME,
  2          xSIZE,
  3          (SOLD - NVL(
  4                      (
  5                       SELECT  SUM(S1.SOLD)
  6                         FROM  STATISTICS S1
  7                         WHERE S1.xSIZE = S.xSIZE
  8                           AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME
  9                           AND TO_CHAR(S1.TIME, 'HH24') != '23'
 10                           AND S1.xSIZE IS NOT NULL
 11                           GROUP BY TRUNC(S1.TIME, 'HH24'),
 12                                    S1.xSIZE
 13                      ),
 14                      0
 15                     )
 16          ) SOLD
 17    FROM  (
 18           SELECT  TRUNC(S.TIME, 'HH24') TIME,
 19                   S.xSIZE,
 20                   SUM(S.SOLD) SOLD
 21             FROM  STATISTICS S
 22             WHERE S.xSIZE IS NOT NULL
 23             GROUP BY TRUNC(S.TIME, 'HH24'),
 24                      S.xSIZE
 25           --ORDER BY 1 DESC
 26          ) S
 27    ORDER BY TIME DESC,
 28             xSIZE ASC
 29  /
         SELECT  TRUNC(S.TIME, 'HH24') TIME,
                       *
ERROR at line 18:
ORA-00979: not a GROUP BY expression

SQL> SELECT  TIME,
  2          xSIZE,
  3          (SOLD - NVL(
  4                      (
  5                       SELECT  SUM(S1.SOLD)
  6                         FROM  STATISTICS S1
  7                         WHERE S1.xSIZE = S.xSIZE
  8                           AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME
  9                           AND TO_CHAR(S1.TIME, 'HH24') != '23'
 10                           AND S1.xSIZE IS NOT NULL
 11                           GROUP BY TRUNC(S1.TIME, 'HH24'),
 12                                    S1.xSIZE
 13                      ),
 14                      0
 15                     )
 16          ) SOLD
 17    FROM  (
 18           SELECT  TRUNC(S.TIME, 'HH24') TIME,
 19                   S.xSIZE,
 20                   SUM(S.SOLD) SOLD,
 21                   ROW_NUMBER() OVER(ORDER BY SUM(S.SOLD)) RN
 22             FROM  STATISTICS S
 23             WHERE S.xSIZE IS NOT NULL
 24             GROUP BY TRUNC(S.TIME, 'HH24'),
 25                      S.xSIZE
 26           --ORDER BY 1 DESC
 27          ) S
 28    ORDER BY TIME DESC,
 29             xSIZE ASC
 30  /

TIME      XS       SOLD
--------- -- ----------
20-SEP-11 L           9
20-SEP-11 M           0
20-SEP-11 XL         11
20-SEP-11 L          51
20-SEP-11 M          13
20-SEP-11 XL         10

6 rows selected.

SQL> 

Or use the subquery factoring (WITH clause) + undocumented hint of MATERIALIZATION:

SQL> WITH S AS (
  2             SELECT  /*+ MATERIALIZE */ TRUNC(S.TIME, 'HH24') TIME,
  3                     S.xSIZE,
  4                     SUM(S.SOLD) SOLD
  5               FROM  STATISTICS S
  6               WHERE S.xSIZE IS NOT NULL
  7               GROUP BY TRUNC(S.TIME, 'HH24'),
  8                        S.xSIZE
  9             --ORDER BY 1 DESC
 10            )
 11  SELECT  TIME,
 12          xSIZE,
 13          (SOLD - NVL(
 14                      (
 15                       SELECT  SUM(S1.SOLD)
 16                         FROM  STATISTICS S1
 17                         WHERE S1.xSIZE = S.xSIZE
 18                           AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME
 19                           AND TO_CHAR(S1.TIME, 'HH24') != '23'
 20                           AND S1.xSIZE IS NOT NULL
 21                           GROUP BY TRUNC(S1.TIME, 'HH24'),
 22                                    S1.xSIZE
 23                      ),
 24                      0
 25                     )
 26          ) SOLD
 27    FROM  S
 28    ORDER BY TIME DESC,
 29             xSIZE ASC
 30  /

TIME      XS       SOLD
--------- -- ----------
20-SEP-11 L           9
20-SEP-11 M           0
20-SEP-11 XL         11
20-SEP-11 L          51
20-SEP-11 M          13
20-SEP-11 XL         10

6 rows selected.

SQL> 

SY.

Tags: Database

Similar Questions

  • Bug? If not, how it worked... (Oracle 11.2.0.1.0)

    I was watching one of the thread in this forum where a poster posted a solution Re: Goup of having clause
    bkd@Oracle>select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    
    bkd@Oracle>drop table im;
    
    Table dropped.
    
    bkd@Oracle>CREATE TABLE im AS
      2    (SELECT 1       ID,
      3            SYSDATE DT
      4     FROM   dual
      5     UNION ALL
      6     SELECT 1           ID,
      7            SYSDATE + 1 DT
      8     FROM   dual
      9     UNION ALL
     10     SELECT 2       ID,
     11            SYSDATE DT
     12     FROM   dual
     13     UNION ALL
     14     SELECT 3       ID,
     15            SYSDATE DT
     16     FROM   dual
     17     UNION ALL
     18     SELECT 4           ID,
     19            SYSDATE + 3 DT
     20     FROM   dual
     21     UNION ALL
     22     SELECT 4           ID,
     23            SYSDATE + 2 DT
     24     FROM   dual
     25     UNION ALL
     26     SELECT 4           ID,
     27            SYSDATE + 2 DT
     28     FROM   dual);
    
    Table created.
    
    
    bkd@Oracle>SELECT *
      2  FROM   im
      3  ORDER  BY 1;
    
            ID DT
    ---------- ---------
             1 05-SEP-12
             1 06-SEP-12
             2 05-SEP-12
             3 05-SEP-12
             4 08-SEP-12
             4 07-SEP-12
             4 07-SEP-12
    
    7 rows selected.
    
    bkd@Oracle>SELECT MAX(DT) s
      2     FROM IM
      3     GROUP BY id;
    
    S
    ---------
    06-SEP-12
    05-SEP-12
    08-SEP-12
    05-SEP-12
    bkd@Oracle>SELECT MAX(DT) --Intentionaly replaced by DT instead of S
      2     FROM (SELECT MAX(DT) s
      3                 FROM IM
      4                 GROUP BY id);
    SELECT MAX(DT) --Intentionaly replaced by DT instead of S
               *
    ERROR at line 1:
    ORA-00904: "DT": invalid identifier
    But when I tried to run the slot sql, it has not failed. Just trying to figure how it worked!
    bkd@Oracle>SELECT ID  FROM IM
      2  WHERE DT =(SELECT MAX(DT)
      3                FROM (SELECT MAX(DT) s
      4                   FROM IM
      5                   GROUP BY id));
    
            ID
    ----------
             1
             1
             2
             3
             4
             4
    Concerning
    Biju

    ED: Provided the version number

    Published by: biju2012 on Sep 5, 2012 01:09

    Not a bug. Expected behavior. What you have is a correlated subquery:

    SELECT  MAX(DT)
      FROM (
            SELECT  MAX(DT) s
              FROM  IM
              GROUP BY id
           )
    

    Oracle must resolve (DT) MAX. First it looks at

    SELECT  MAX(DT) s
      FROM  IM
      GROUP BY id
    

    and obviously can not solve. So it seems im referenced in the main query:

    SELECT  ID
      FROM  IM
      WHERE DT = 
    

    and so where clause compares DT to himself. It is easier to illustrate what the supposed alias help:

    SELECT  A.ID
      FROM  IM A
      WHERE A.DT = (
                    SELECT  MAX(A.DT)
                      FROM (
                            SELECT  MAX(B.DT) s
                              FROM  IM B
                              GROUP BY B.id
                           )
                   );
    

    The foregoing shows you how names used in your query are resolved.

    SY.

  • Last group of patches for oracle 11 g 2 in aix

    Hai,
    What is the last group of patches for oracle 11 g 2 in aix.

    Hello

    You can download 11.2.0.2 patch group.

    Patch number * 10098816 *- family of Oracle database: patch 11.2.0.2.0 PATCH SET for ORACLE DATABASE SERVING group

    This can be downloaded from http://support.oracle.com, need a valid CSI and account number.

    See also technical note Mos:
    * 1189783.1 changes to the Oracle database sets from 11.2.0.2 *.

    http://appsdbaworkshop.blogspot.com/2011/03/Oracle-11gr2-inplace-and-out-of-place.html

    Thank you
    A H E E R X

  • Is this bug reports Oracle - 'break the order property' in the report "above.

    Is this bug reports Oracle - 'break the order property' in the report "above.

    Anyone would confirm that in the report 'group above', we could only order the values in the column of brake with ' "nil" or "ascending" or "descending" provided by "pause command property? '"

    In the following example, "Dept" is brake column. Reports Oracle allows the values of the order in 'Dept' with 'descendant' provided by 'pause order property:

    Dept. 30
    employment ename salary
    xxx xxx xxx
    xxx xxx xxx

    20 DEP.
    employment ename salary
    xxx xxx xxx
    xxx xxx xxx

    Dept 10
    employment ename salary
    xxx xxx xxx
    xxx xxx xxx

    or "Crescent" provided by "pause order property:

    Dept 10
    employment ename salary
    xxx xxx xxx
    xxx xxx xxx

    20 DEP.
    employment ename salary
    xxx xxx xxx
    xxx xxx xxx

    Dept. 30
    employment ename salary
    xxx xxx xxx
    xxx xxx xxx

    I have to do:

    20 DEP.
    employment ename salary
    xxx xxx xxx
    xxx xxx xxx

    Dept 10
    employment ename salary
    xxx xxx xxx
    xxx xxx xxx

    Dept. 30
    employment ename salary
    xxx xxx xxx
    xxx xxx xxx

    Could I do it? Could someone confirm that we could never do this, or if so, how?

    Million thanks for the advice.

    M.Z.

    Edited by: jielan 18 September 2010 08:23

    Why must be a bug? You have a customs provision and must find a way to fill. But, what is your real sort order? You have only the three departments? If so, you could add a column in your query as

    DECODE(DEPT,  20, 1, 10, 2, 30, 3, 4) SORTING
    

    put this column in the same group as dept and sort after this new column.

  • The Group of hotfixes check Oracle and the set of patches available

    Hello

    Is there a documentation available on metalink or in the forum regarding
    existing patches group looking for oracle DB, clusterware & applications. Oracle Server
    and
    that the recommended placement group of patches from oracle for patches existing for above items group?
    Thank you

    Please read the note of My Oracle Support * ALERT: Oracle 11 g Release 1 (11.1) Support Status and alerts [454507.1 ID] *.

    Such a document exists for each major version of Oracle database: 10.1, 10.2, 11.1 and 11.2, etc..

    Edited by: P. Forstmann may 25, 2010 16:26

  • A way to group controls and indicators on the Front Panel and that they can be made Visible or not as a group?

    I would like to combine several orders and LEDs on the front panel in a group in a way that allows me to do the whole group Visible or not.

    I tried to use a Cluster, but it has a side effect that all elements must be inside the controls or indicators, but not mixed.

    Is there any graphic element, like a panel that can contain other controls and indicators on the inside and make them Visible or not as a group regardless of whether they are commands or the LEDs?

    Good suggestions on how to do this?

    Thank you.

    The tab control is still not my favorite, appearance but it's a way fast and effective to show and hide groups of controls and indicators.

  • Maximum number of e-mail addresses in an Outlook Express 'group '.

    Please, what is the maximum number of e-mail addresses that can be assembled in an Outlook Express "group"?

    There is no limit. But your ISP probably has a restriction of the recipients how much you can send simultaneously.

  • Setting IE/Live Hotmail as default mail client, so it responds to a click on a mailto link: link and not Outlook Express

    It is actually in two parts/problems; Maybe (probably) closely related.
    ... And it's weird because it used to work (weird especially when it comes to problem no. 1 b).

    Problem # 1
    When I click on an e-mail address embedded (a mailto link :) in some (.doc .rtf, .html, etc.) I opened, I want to have the system open IE, connect me to my Windows Live Hotmail (http://mail.live.com/...) account and open the new page/screen e-mail message.) He used to do this. I have somehow messed up things upwards; How I know not (duh). Instead, it will now fire a new Message Outlook Express 6.0 dialog box.

    (1) I'm under Win XP Pro SP3 with all the critical updates installed.

    (2) I have a hotmail.com account and the system has my saved credentials.

    (3) I have Windows Live Messenger and Windows Live Mail is installed.

    (4) I have Windows Live Messenger is set up (under the menu item Tools/Options/Connection tab) with:
    a. "automatically run Windows Live Messenger when I connect Windows' checked
    b. "'Main window open Windows Live Messenger to Windows Live Messenger startup' UNchecked '.
    c. "automatically open a session when connected to the Internet" checked

    (5) I have Windows Live Mail set up (the tab Tools/Options/connections point menu - sign in to Windows Live services section) to "Stop signing In" - i.e. the "Sign In" button is enabled and the 'Stop Signing In' button is disabled (because it is already selected)

    This configuration (4 & 5) is so when I right click on the Windows Live Messenger icon in the system Notification bar and select 'Mail box' in the menu contextual, Messenger opens IE to my Hotmail Live (http://mail.live.com/...) account, sign me and puts me in my Inbox as opposed to the opening of the Live Mail client. No problem, it's what I want. The only time where I use the client Live Mail is when I have to compose an e-mail with pictures incorporated into the body of the message (which is rare), and then I manually start it (Live Mail). This can be done using IE/Live Hotmail; I can only attach photos there, not incorporated the. That's how my system was config support when you click on a mailto link: link would open up IE/Live Hotmail and not Outlook Express.

    In addition,
       
    (6) I have:
    a. under the radio button "Use my current e-mail program" Set Program Access and Defaults/Custom is selected and have the box "enable access to this program" UNchecked for Outlook Express (I also tried uncheck the 'enable...) "for Windows Live Mail - no change.

    I then tried...
    (b) in "Add/Remove Windows components" untick the Outlook Express check box. I then let XP run installation and rebooted.

    The reason why I did 6 b is to see what tracks if Outlook Express is not installed.
    Now, where is start to get weird and brings me to...

    Problem no. 1 b
    Outlook Express 6.0 (OE6.0) be uninstall under XP Pro/SP3 and if so, how?

    After step 6 b restarts, I open a file with a link to e-mail built in, clicked on it and now it opens nevertheless OE6.0
    So I open Win Explorer and of course the folder as c:\programs\outlook Express is still there and complete with all files .dll, .exe, etc..
    Now I'm really scratching my head! I know I said XP installation does not install Outlook Express.

    So now I decide to play with fire...
    I open the upward Task Manager to see which runs when the new Message of OE6.0 dialog box is in place (this is msimn.exe)
    So just to smile and laugh, I msimn.exe and rename it to Xmsimn.exe, go back in the file with the link, click on it and what's going on, you guessed it, OE6.0 is running! I switch back to Win Explorer, and the renamed file is still there, but now IS msimn.exe BAAAACK!
     
    Now, here's where it comes down right spoooooky. I created a new folder in C:\Programs\Outlook Express, all of the files selected in the C:\Programs\Outlook Express and drop them in the new folder. And then looking at the contents of the Outlook Express folder in the right pane (which is now empty other than the new folder), one by one, all the files OE re - APPEAR in the OE folder.
    WHAT IS PAST WITH IT!

    All the files that I moved to the new folder are still there, including the renowned Xmsimn.exe.
    It is as if the system will not let you remove the OE components and withdrew them a .cab file, somewhere, even if I said do not install Outlook Express!

    Now, this problem is really secondary to # 1 has. I don't really need the answer, he just freaks me the system is something like this and I would like to know how and why of it. I use any OE 6.0, it's just take disk space.
    (I even uninstalled my installation of MS Office Outlook)

    And I don't like how # 1a is resolved. I am quite able to pull the top of RegEdt32 or what is needed to fix it (after backup the registry and/or a restore point first, of course.)

    Any ideas?

    Thanks in advance,
    Paul

    Well, I found the answer to problem # 1 to myself.
    Somehow the IE Tools/Internet Options/programs Internet/tab setting programs section e-mail field has NOT been defined. It was empty.
    I put it to "Windows Live Hotmail" and BINGO! Click on an embedded mailto: link and pops up a new IE window connected to my Hotmail account, open electronic 'Composer the Message' page with the To: field with the link I clicked on.

    Now if only one of you gurus out there can answer problem # 1 b (can Outlook Express 6.0 (OE6.0) be uninstall under XP Pro/SP3 and if so, how? -see my OP) I'll be in sleep with nightmares of moved files reappear magically in an empty folder!

  • TMSPE Migration fails - could not create the Group

    Hello

    The performance of the Migration tool after installation TMSPE, I get 1 error warning and 1. From downstairs, it seems that {soul} is the problem here, but where can I change it with the recommended replacements? I see not {soul} anywhere in the model FindMe Provisioning or anywhere elsewhere in the TMS...

    CAUTION:

    Caller id model invalid for mycompany group could not migrated: [email protected] / * /. Legal replacement values are {mobile_phone} and {office_phone}.

    ERROR:

    Could not create the group for {display_name = [mycompany], display_name_pattern is [{display_name}], video_uri_pattern_inherited = [false], video_uri_pattern is [[email protected] / * /], device_uri_pattern = [[email protected] / * /], device_uri_pattern_inherited = [false]} URL: / groups the exception returned by the API was the argument

    [email protected] / * /.

    is the invalid state: Code of state InvalidArgument: 1005.

    The exception message is: POST

    http://localhost:8788/ur/groups returned a 400 Bad Request response status

    Could not create the group for {display_name = [mycompany], display_name_pattern is [{display_name}], video_uri_pattern_inherited = [false], video_uri_pattern is [[email protected] / * /], device_uri_pattern = [[email protected] / * /], device_uri_pattern_inherited = [false]} URL: / groups the exception returned by the API was the argument

    [email protected] / * / is the invalid state: Code of state InvalidArgument: 1005.

    The exception message is: POST

    http://localhost:8788/ur/groups returned a 400 Bad Request response status

    Anyone can shed some light on this?

    Thank you

    Tom

    You can try to remove the device uri scheme and the findme bosses and then try to make the migration again. If its success, you can re - fill these easy once tmspe is running.

    / Magnus

    Sent by Cisco Support technique iPhone App

  • Clock on windows 8 is wrong time, I tried to set the time of the internet but its still not working, think theres a bug in the clock time, anyone have the same problem for windows 8 and know how to fix?

    Clock on windows 8 is wrong time, I tried to set the time of the internet but its still not working, think theres a bug in the clock time, anyone have the same problem for windows 8 and know how to fix?

    It sets obtained :-) Sorry for the delay

    Thank you very much! has worked perfectly!

  • Not a "simple-group function.

    SQL > select max(THREAD#), SEQUENCE #, NAME from v$ archived_log;

    Select max(THREAD#), SEQUENCE #, NAME from v$ archived_log

    *

    ERROR on line 1:

    ORA-00937: not a single group group function

    Often, I face "not a single-group function. I tried with the order by clause, also,

    -Please clarify why this error occurs?

    Hello

    You must use Group by clause in your query when you use the Group feature as count, sum, max in query

    Select max(THREAD#), SEQUENCE #, NAME of Group v$ archived_log by SEQUENCE #, NAME;

    Thank you

    Su.GI

  • Where can I find the 2 stucco that comes with photoshop, is not in the group. Co

    Where can I find the 2 stucco that comes with photoshop, is not in the group. Co

    Hello

    The model of stucco 2 should be in patterns of Texture Fill 2 .

  • not a single group function

    Hello


    I have this request with me
    select  
    mst.ENTRY_DATE    ordered_date , mst.FIELD, 
    V.ADDRESS1        Address   , 
    OPN_JOB_DESC      job_number,
    ra.CUSTOMER_NAME    customer_NAME, 
    DECODE ( GROSS_ITEM_REF , NULL , SUBSTR (PRODUCT_ATTR_VAL_DISP , INSTR( PRODUCT_ATTR_VAL_DISP, '.', -1, 1) + 1  ) , GROSS_ITEM_REF )      item_number, 
    dECODE (GROSS_ITEM_NAME , NULL,itm.attribute2,GROSS_ITEM_NAME  )        item_description, 
    subdtlest.ITEM_UOM                unit_of_measurement, 
    SUM ( subdtlest.QTY_ISSUE  )            Quantity_Issue,
    sum(nvl (subdtlest.CALC_CEMENT_SK ,subdtlest.CALC_AMOUNT ) )    quantity ,
    mst.DN_DESCRIPTION   Description
    --decode(MST.DESCRIPTION ,NULL ,mst.DN_DESCRIPTION,MST.DESCRIPTION) Description
     from 
       XXNP_OPN_JOBLOG_001          mst , 
       XXNP_OPN_JOBLOG_STAGE_002   dtl , 
       XXNP_OPN_JOBLOG_SLURRY_003  subdtl ,
       XXNP_OPN_JOBLOG_EST_002     subdtlest,
       qp_list_lines_v            line  ,
       QP_LIST_HEADERS_TL          head  ,
       QP_LIST_HEADERS_B           curr,   
       ra_customers ra ,
       AR_ADDRESSES_V v ,
       MTL_SYSTEM_ITEMS itm  
       where   
    dtl.OPN_JOBLOG_001_ID                        = mst.OPN_JOBLOG_001_ID         AND 
    subdtl.OPN_JOBLOG_001_ID                = dtl.OPN_JOBLOG_001_ID          AND
    subdtl.OPN_JOBLOG_006_ID                  = dtl.OPN_JOBLOG_006_ID         and  
    subdtlest.OPN_JOBLOG_001_ID           = subdtl.OPN_JOBLOG_001_ID       AND
    subdtlest.OPN_JOBLOG_006_ID         = subdtl.OPN_JOBLOG_006_ID      AND
    subdtlest.OPN_JOBLOG_007_ID         = subdtl.OPN_JOBLOG_007_ID      AND
    line.LIST_HEADER_ID          =       head.LIST_HEADER_ID                          and  
    curr.LIST_HEADER_ID              =   head.LIST_HEADER_ID                        and  
    substr ( PRODUCT_ATTR_VAL_DISP , 1, instr ( PRODUCT_ATTR_VAL_DISP ,'.' )-1 )  = subdtlest.ITEM_NUMBER
    and   itm.SEGMENT3 = substr ( PRODUCT_ATTR_VAL_DISP , INSTR(PRODUCT_ATTR_VAL_DISP, '.', -1, 1) + 1  ) 
    and   mst.CONTRACT                       =  head.name   
    and   RA.CUSTOMER_ID = v.CUSTOMER_ID
    and   ra.customer_id = mst.customer_id
    and   V.ADDRESS1 =  mst.CONTRACT      
    and mst.OPN_JOB_DESC='K/D/UP24/UN006/KOP/PL/0112/1'
    and itm.ORGANIZATION_ID  =103
    and itm.INVENTORY_ITEM_STATUS_CODE = 'Active'
    group by 
    mst.ENTRY_DATE ,  
    V.ADDRESS1     , 
    OPN_JOB_DESC   ,mst.FIELD,
    ra.CUSTOMER_NAME , 
    substr ( PRODUCT_ATTR_VAL_DISP , INSTR(PRODUCT_ATTR_VAL_DISP, '.', -1, 1) + 1  ), 
    itm.ATTRIBUTE2        , 
    subdtlest.ITEM_UOM ,
    mst.DN_DESCRIPTION  ,GROSS_ITEM_REF ,GROSS_ITEM_NAME
    order by  substr ( PRODUCT_ATTR_VAL_DISP , INSTR(PRODUCT_ATTR_VAL_DISP, '.', -1, 1) + 1  )   Asc
    
    i require  a field called balance which is sum of Quantity_issue and Quantity fields
    i tried this
    
    select  
    mst.ENTRY_DATE    ordered_date , mst.FIELD, 
    V.ADDRESS1        Address   , 
    OPN_JOB_DESC      job_number,
    ra.CUSTOMER_NAME    customer_NAME, 
    DECODE ( GROSS_ITEM_REF , NULL , SUBSTR (PRODUCT_ATTR_VAL_DISP , INSTR( PRODUCT_ATTR_VAL_DISP, '.', -1, 1) + 1  ) , GROSS_ITEM_REF )      item_number, 
    dECODE (GROSS_ITEM_NAME , NULL,itm.attribute2,GROSS_ITEM_NAME  )        item_description, 
    subdtlest.ITEM_UOM                unit_of_measurement, 
    SUM ( subdtlest.QTY_ISSUE  )            Quantity_Issue,
    sum(nvl (subdtlest.CALC_CEMENT_SK ,subdtlest.CALC_AMOUNT ) )    quantity ,
    sum(sum(nvl (subdtlest.CALC_CEMENT_SK ,subdtlest.CALC_AMOUNT ) ) + SUM ( subdtlest.QTY_ISSUE  )  )balance,
    mst.DN_DESCRIPTION   Description
    --decode(MST.DESCRIPTION ,NULL ,mst.DN_DESCRIPTION,MST.DESCRIPTION) Description
     from 
       XXNP_OPN_JOBLOG_001          mst , 
       XXNP_OPN_JOBLOG_STAGE_002   dtl , 
       XXNP_OPN_JOBLOG_SLURRY_003  subdtl ,
       XXNP_OPN_JOBLOG_EST_002     subdtlest,
       qp_list_lines_v            line  ,
       QP_LIST_HEADERS_TL          head  ,
       QP_LIST_HEADERS_B           curr,   
       ra_customers ra ,
       AR_ADDRESSES_V v ,
       MTL_SYSTEM_ITEMS itm  
       where   
    dtl.OPN_JOBLOG_001_ID                        = mst.OPN_JOBLOG_001_ID         AND 
    subdtl.OPN_JOBLOG_001_ID                = dtl.OPN_JOBLOG_001_ID          AND
    subdtl.OPN_JOBLOG_006_ID                  = dtl.OPN_JOBLOG_006_ID         and  
    subdtlest.OPN_JOBLOG_001_ID           = subdtl.OPN_JOBLOG_001_ID       AND
    subdtlest.OPN_JOBLOG_006_ID         = subdtl.OPN_JOBLOG_006_ID      AND
    subdtlest.OPN_JOBLOG_007_ID         = subdtl.OPN_JOBLOG_007_ID      AND
    line.LIST_HEADER_ID          =       head.LIST_HEADER_ID                          and  
    curr.LIST_HEADER_ID              =   head.LIST_HEADER_ID                        and  
    substr ( PRODUCT_ATTR_VAL_DISP , 1, instr ( PRODUCT_ATTR_VAL_DISP ,'.' )-1 )  = subdtlest.ITEM_NUMBER
    and   itm.SEGMENT3 = substr ( PRODUCT_ATTR_VAL_DISP , INSTR(PRODUCT_ATTR_VAL_DISP, '.', -1, 1) + 1  ) 
    and   mst.CONTRACT                       =  head.name   
    and   RA.CUSTOMER_ID = v.CUSTOMER_ID
    and   ra.customer_id = mst.customer_id
    and   V.ADDRESS1 =  mst.CONTRACT      
    --and   OPN_JOB_DESC = :P_JOB_NUMBER
    and itm.ORGANIZATION_ID  =103
    and itm.INVENTORY_ITEM_STATUS_CODE = 'Active'
    and mst.OPN_JOB_DESC='K/D/UP24/UN006/KOP/PL/0112/1'
    group by 
    mst.ENTRY_DATE ,  
    V.ADDRESS1     , 
    OPN_JOB_DESC   ,mst.FIELD,
    ra.CUSTOMER_NAME , 
    substr ( PRODUCT_ATTR_VAL_DISP , INSTR(PRODUCT_ATTR_VAL_DISP, '.', -1, 1) + 1  ), 
    itm.ATTRIBUTE2        , 
    subdtlest.ITEM_UOM ,
    subdtlest.CALC_CEMENT_SK ,subdtlest.CALC_AMOUNT, subdtlest.QTY_ISSUE ,
    mst.DN_DESCRIPTION  ,GROSS_ITEM_REF ,GROSS_ITEM_NAME
    order by  substr ( PRODUCT_ATTR_VAL_DISP , INSTR(PRODUCT_ATTR_VAL_DISP, '.', -1, 1) + 1  )   Asc
    
    but i get the cursor pointing to mst.entry_date and the message "not a single group function"
    
    kindly guide me
    thanking in advance
  • Migration of Lotus Notes e-mail groups in the hive

    Is it possible to reproduce our existing Lotus Notes e-mail groups in the hive?

    Edited by: dazimon June 23, 2011 07:59

    Sorry,

    Distribution list - my apologies for the jargon.

    Phil

  • the provider is not compatible with the version of the oracle client

    Hello

    I have the Oracle 10 g database in my production server *(windows 2000 server SP4) * and I use ODAC 11 g (11.1.0.6.21) for the connection of the .net code database.

    During execution of the code, I get the following error: the vendor is not compatible with the version of the Oracle client.

    But the same code works file in my system *(windows xp SP2) dev *.

    Any help is appreciated.

    Thank you!

    Hello

    Thanks for the information.

    One point that we have several versions of Oracle on the prod server. This can be a reason?

    Yes, if an older version of the client is first in the system path. Can you verify the system path and confirm if an older version of the client is in the path before the 11.1.0.6 version?

    Thank you

    Mark

    Edit1: See also the comments of Alex on DllPath here:

    Issue of ODP.Net

    Published by: Mark Williams on July 30, 2009 18:01

Maybe you are looking for