Help with error - 934 group function is not allowed here

Hey there will, I'm having problems with a request and just does not know how to do it without error.

I'm trying to get all the employee emerging infectious diseases that have less than 2 number max of DID (dependants) in the table.

It's my current query

SELECT Employee.LName. ' ' || Employee.Fname as Full_Name, Employee.EID

The left outer JOIN employee depends on Employee.EID = Dependent.EID

Having Count (DID)--2 > ((select Max (N) as From (SELECT Employee.EID, Count (DID) As N FROM Employee Inner Join Dependent On Employee.EID = Dependent.EID group by Employee.EID, Count (DID))) N)

Order of Employee.Lname, Employee.Fname

Which gives me an error on column 4, no matter what I do. If I remove the Count (DID) in the group by clause (which I tried it earlier), it gives me a is not an error of the function of single group...

The most frustrating thing is that

Select Max (N) as From (SELECT Employee.EID, Count (DID) As N FROM Employee Inner Join Dependent On Employee.EID = Dependent.EID group by Employee.EID) N

Works perfectly, but because it's a mission, I have to do in one step (no substeps/views)

Any help?

Thank you very much

Hello

ac981e5d-D10A-4520-BF42-23a894d04fb7 wrote:

Ok. I'm taking your code in a view... I get this.

and there is an orange underscore and a text of the error that says

Select incoherent list in group by... change the group by clause of e.fname, e.lname, e.eid, count, max

Which isn't what either the Oracle database would do.  Everything about orange (or any other color) sounds like it is caused by a front-end that could be interacting with Oracle.  In addition, the Oracle error messages always come with a 3-letter-5 code, as ORA-00933.

under the selection internal (first medium)

You have deleted the WITH clause.  The parser can recognize the error when it has reached the first left parenthesis.

Create view AS A10T2

(

SELECT e.lname. ' ' || e.fname AS full_name

e.eid

(D.) AS this_group_count

MAX (COUNT (d.)) ON (AS highest_group_count)

E employee

LEFT OUTER JOIN dependent d ON e.eid = d.eid

GROUP BY e.lname, e.fname, e.eid

)

SELECT full_name

eid

Of aggregate_results

WHERE this_group_count > = highest_group_count - 2

ORDER BY full_name

You need the WITH to define this clause means "AGGREGATE_RESULTS":

Create view AS A10T2

WITH aggregate_results AS

(

SELECT e.lname. ' ' || e.fname AS full_name

...

Why do you have an ORDER BY clause in a view?   (It is probably not cause of your errors, just make the inefficient view)

Command line error: column 5: 23

Error report-

SQL error: ORA-00933: SQL not correctly completed command

00933 00000 - "not correctly completed SQL command.

* Cause:

* Action:

This is another indication that some front is getting involved.  Looks like your front-end reports the exact Oracle error message, "0RA-00933" and then builing it's own error code, "00933. 00000 ", on this basis.  ORA-00933 is a reasonable mistake to wait if you omit the line ' WITH the aggregated results AS.  Once again, until I can actually run your code, I can't test it, and I can't run your code until you post CREATE TABLE and INSERT statements for some examples of data, or change the problem to use commonly available tables, such as those in the scott schema.

and when I try my code

CREATE VIEW A10T2 AS

SELECT Employee.LName. ' ' || Employee.Fname as Full_Name, Employee.EID

The left outer JOIN employee depends on Employee.EID = Dependent.EID

Seen (Count (DID)) + 2 > (select Max (N) From (SELECT Employee.EID, Count (DID) As "N" FROM Employee Inner Join Dependent On Employee.EID = Dependent.EID group by Employee.EID))

Order of Employee.Lname, Employee.Fname

I get

Command line error: column 2: 8

Error report-

SQL error: ORA-00937: not a function of simple-group

00937 00000 - 'not a single-group function.

* Cause:

* Action:

Then the orange underscore even under my inner ("select employee. EID, Count (DID) as "N" ") says to change the Group of Employee.eid, Count (DID)

I just don't understand why he tells me to group them by Count (DID)?

Isn't that what you did in your original post, and I have explained in answer #2?  If you continue to repeat the same mistake, you can expect continue to get the same error.  Given that you have a code, you know causes an error, do you think really that what makes a vision will cause the error to disappear?

The inner query works fine on its own...

Right; It's the outer query where you are missing the GROUP BY clause.

Tags: Database

Similar Questions

  • PL/SQL: ORA-00934: Group feature is not allowed here

    Hello

    I write a PL/SQL procedure. The structure is like:

    SET SERVEROUTPUT ON;
    CREATE or REPLACE procedure abc

    IS
    v_total_ip_rec number (14);
    v_total_op_rec number (14);
    v_total_rec number (14);


    BEGIN
    SELECT SUM (CASE
    WHEN < condition 1 >
    THEN 1
    0 OTHERWISE
    END
    ) in v_total_ip_rec.
    SUM (CASE
    WHEN < condition 2 >
    THEN 1
    0 OTHERWISE
    END
    ) in v_total_op_rec.
    SUM (1) in v_total_rec
    OF A, B
    WHERE A.Col1 = B.Col1;

    EXCEPTION
    WHILE OTHERS THEN
    raise_application_error (-20001,' an error has occurred - ' |) SQLCODE |' - ERROR - ' | SQLERRM);
    END;


    When I run this procedure it gives me following error:
    "PL/SQL: ORA-00934: Group feature is not allowed here."

    Someone has an idea?

    Any help would be appreciated.

    Thank you.

    Should I have any special role?

    Have you checked if synonyms exist for tables?
    Please check in this order:

    #1-synonymes appropriate
    #2-appropriate privileges
    #3-appropriate roles

  • ORA-00934: Group feature is not allowed here

    CREATE or REPLACE PROCEDURE First(
    date1 IN Date,
    date2 IN Date
    )
            AS
    
    date3 employee.start_date%TYPE;
    date4 employee.start_date%TYPE;
    
    Begin
    select min(start_date) into date3 from employee where start_date between date1 AND date2;
    END;
    /
    Above procedure is completed successfully

    But when I changed the query to

    Select min (start_date) date3, max (start_date) in date4 of employee where start_date between date1 AND date2.
    then I get the error message
    ORA-00934: Group feature is not allowed here.
    Why this error happens during execution, but on sqlplus query is executed successfully.
    I checked this in oerr ora-00934 but not able to understand what measures should be taken
    select min(start_date)
    ,      max(start_date)
    into   date3
    ,      date4
    from   employee
    where  start_date between date1 AND date2;
    
  • Group feature is not allowed here

    Hello

    I have a problem running the following sql command, I know that the error is the count function, but I don't know how to solve this problem. Can you please help me solve this problem.
    (I like to select titles that have more than 2 authors).

    Separate select titles.title_id, titles.title_name, titles.publisher_ID
    authors, titles, and author_titles
    where titles.title_ID = author_titles.title_id
    and author_titles.au_id = authors.au_id and count (authors) > 2
    ORDER BY titles.title_id DESC;

    Thank Yoy

    Hello

    You group by expression is absent from the columns you have in your select statement

      SELECT titles.title_id,
             titles.title_name,
             titles.publisher_ID    FROM authors, titles, author_titles
       WHERE titles.title_ID = author_titles.title_id
             AND author_titles.au_id = authors.au_id
    GROUP BY titles.title_id, titles.title_name, titles.publisher_ID
      HAVING COUNT ( * ) > 2
    ORDER BY titles.title_id DESC;
    

    Concerning
    OrionNet

  • Error ORA-02287: sequence number not allowed here

    Hello

    I got an error ORA-02287: unauthorized here when you run sql statement insert below sequence number.

    INSERT INTO SI_KEY_DBF
    (M_IDENTITY, M_REF, M_GROUP, M_, M_TYPE, M_MULTIPLE, M_START, M_END, M_PREVIOUS, M_NEXT, M_INS_DATE, M_MOD_DATE,
    M_INS_TIME, M_MOD_TIME, M_AMEND, M_LABEL, M_ENTITY, M_TRN_FAMILY, M_TRN_GROUP, M_TRN_TYPE, M_CURRENCY,
    M_O_CUR, M_NOVO, M_CRDE, M_CODE, M_USER, M_VAL_STATUS, M_STL_METHOD, M_TRD_SECT, M_COMMENT, M_MARKET,
    M_CLEARER, M_SI_TCI)
    (SELECT M_IDENTITY, (SELECT SI_KEY_DBFS.nextval FROM dual), M_GROUP, m_, M_TYPE, M_MULTIPLE, NULL, NULL, M_PREVIOUS, M_NEXT, SYSDATE, SYSDATE,
    To_Char(sysdate,'HH:mm:SS'), To_Char(SYSDATE,'HH:MM:SS'), 0, M_LABEL, M_ENTITY, M_TRN_FAMILY,.
    M_TRN_GROUP, M_TRN_TYPE, M_CURRENCY, M_O_CUR, M_NOVO, M_CRDE, M_CODE, M_USER, M_VAL_STATUS,
    M_STL_METHOD, M_TRD_SECT, M_COMMENT, M_MARKET, M_CLEARER, M_SI_TCI FROM SI_KEY_DBF WHERE M_REF IN
    (M_REF SELECT TABLE #DATA #SITRN_DBF WHERE M_HLD_AC IN (SELECT IDXOAC FROM DDINDX)))

    Can someone help me on how to solve this problem? Really appreciate your help. Thank you.

    >
    (SELECT M_IDENTITY, (SELECT SI_KEY_DBFS.nextval FROM dual),
    >
    You already choose to get rid of the nested select statement and simply use the value

    (SELECT M_IDENTITY, SI_KEY_DBFS.nextval, 
    
  • Group feature is not allowed

    Hi all...

    When I run the following text in the SQL command screen, it works fine... But when I try to use it in the APEX to fill the values on the page, it gives me error...

    ERROR
    1 error has occurred
    ORA-06550: line 25, column 74: PL/SQL: ORA-00934: Group feature is not allowed here ORA-06550: line 24, column 1: PL/SQL: statement ignored


    CODE THAT WORKS IN THE FORM OF SQL COMMAND

    SELECT
    SUM(CASE WHEN SLOT = 'Q' THEN '1' ELSE '0' END) AS C_SLOT,
    SUM(CASE WHEN TEST = 'P' THEN '1' ELSE '0' END) ACE C_TEST,
    OF TBL_REC;


    CODE THAT GIVES THE ERROR ON THE APPLICATION EXPRESS PAGE

    SELECT
    SUM (CASE WHEN SLOT = 'Q', THEN '1' OTHER '0' END) IN: P2_C_SLOT,.
    SUM (CASE WHEN TEST = 'P', THEN '1' OTHER '0' END) IN: P2_C_TEST,.
    OF TBL_REC;


    The GBA SLOT and TEST have the letter codes, I want just that it count only when it matches a certain letter. In the form of SQL command, it returns a single line, with the charges, all right. This is only a problem when I try to use anywere on a page in Application Express.

    The full version has about 20 lines that are all rows in the sum, but I can't even the worm 2 lines above to work.

    Any thoughts?

    VR;

    SELECT
    SUM (CASE WHEN SLOT = 'Q', THEN '1' OTHER '0' END)
    SUM (CASE WHEN TEST = 'P', THEN '1' OTHER '0' END) IN: P2_C_SLOT,: P2_C_TEST
    OF TBL_REC;

    Published by: seal of hash on June 3, 2009 12:56

  • Help with error message: "Windows Vista Home Premium product key you typed in is invalid for activation.

    Original title: help with error message... Please...!

    I use a desktop PC of HP Pavilion a6202.uk with Windows Vista Home Premium & Microsoft Office 2003.  When I am back from vacation & turned on my PC, my password was OK, but rather to raise Windows, I received the following message: "Windows Vista Home Premium product key you typed in is invalid for activation.  He then listed the following options: "access your computer with reduced functionality (this will allow you to buy a product online key)" or "Type a different product key" or "contact HP to help solve this problem."

    I have no idea what a product key is and don't have anything either in the type comes to connect as usual.  I can't access anything to be same to reduced functionality.  I can not type in a new product key because I did not.  I can not contact HP - phone number does not... !!

    I'm quite desperate, I travel docs to print and e-mail to answer and I don't have any idea what is happening.  Please can someone help with this not very IT clued-up DTP...!

    Moved from Vista programs Forum.

    You should have a sticker with the product key on your computer, on the bottom, or under the battery cover.  I try to type this key in and see if it accepts it.  If this isn't the case, you might not have an authentic version of Windows installed.

  • A SQL server management studio 2012 error: PERCENTILE_DISC function is not allowed in the current compatibility mode. It can only in mode 110 or higher.

    Our company just upgraded to SQL Server Management Studio 2012 and it has been very useful because I needed to use the percentile for the code I wrote. As a first step, the function did not work because I set the compatibility mode 110 level. After that I did, the function worked. However, now it does not work yet, and I get the same error:

    The PERCENTILE_DISC function is not allowed in the current compatibility mode. It can only in mode 110 or higher.

    I went to the properties of database section, then options and noticed that the compatibility mode has not changed, it is set to "SQL Server 2012 (110). I even used the following code to see if that would help at all even if the compatibility mode is already on this mode:

    ALTER DATABASE Analytics
    SET COMPATIBILITY_LEVEL = 110 
    

    Someone already had this problem or knows if I need to change something in the properties of database for this function work? Is this just a bug in the new version?

    Hello

    I suggest you post this question in the SQL Server 2012 TechNet Forums: http://social.technet.microsoft.com/Forums/en-us/category/sqlserver

    Thank you.

  • Error "LoadLibrary failed with error 126: the module is not found ' at the launch of programs

    Original title:

    From some programs, the program starts partially, then a pop up message saying "LoadLibrary failed with error 126: the module is not found. When you click on the 'OK' button, the program stops. I had this problem with several graphics applications such as PSP and Rhinoceros 3D.

    Any suggestions what can be causing this "error 126"?

    type cmd and click the black box for it...

  • Error creating - snapshot operation is not allowed in the current state

    Hi all

    Using Veeam Backup & Recovery 6 software to replicate a LIVE VM (virtual MACHINE, 1). But I can't and I got the following error:

    Error creating - snapshot operation is not allowed in the current state

    The above virtual machine can only be copied when it is STOPPED the VM is running on ESXi 4.0.

    I have a more LIVE VM (virtual MACHINE, 2) on the ESXi Host which I was able to replicate successfully to another ESXi host.

    I contacted the Veeam Support before posting here.

    Things to note about VM 1: I can't take a snapshot manually from the vSphere client. This option is greyed (disabled) on VM1... While its OK on VM2.

    Veeam support told me that since its software uses the snapshot function of ESXi and this feature is disabled, replication cannot continue.

    Thanks for helping me on this.

    Exactly what I thought. When you delte this PCI passtrough your Backup Exec tape will not longer work.
    You will not be able to do replication when you use this passtrough.

    Only solution for replication (which is what I think you want for purposes of disaster) is to install a 3rd VM (or as physical) as "Backup Server" where you install Backup Exec and enable PCI-Passtrough to your tape drive. Then this new virtual machine with Backup Exec backup.

    After that you can delete the passtrough of your SBS and your replication will work.

    Sorry

    Concerning

    Simon

  • Error when parsing the file ' value of the 'src' attribute is not valid; must be a URI'.  ERROR (RSC-005) to "Hetgeheimfietsen.epub/OEBPS/toc.xhtml" (line 10, col 10): error while parsing the file ' "ol" element not allowed here; wait for the end-tag of t

    The members of the Forum kan help you

    Validation by using version 3.0.1 EPUB rules.

    ()https://github.com/IDPF/epubcheck( )

    December 9, 2015 15:27:33 THIS

    ---------------------------------------------------

    WARNING (OPF-007) to 'Hetgeheimfietsen.epub/OEBPS/content.opf' (line 2, column 227):

    Re-declaration of prefix reserved "rendition."

    ERROR (RSC-005) to "Hetgeheimfietsen.epub/OEBPS/toc.xhtml" (line 10, col 10):

    Error when parsing the file ' "ol" element not allowed here; waiting for the end-tag of the element or element "li" '.

    WARNING (CSS-007) to "Hetgeheimfietsen.epub/OEBPS/css/idGeneratedStyles_0.css" (line 60, col 2):

    Police made OEBPS/font/CambriaMath.ttc refers to fonts not standard type application/x-police-FTT.

    WARNING (PKG-012) to "Hetgeheimfietsen.epub/OEBPS/De_Alpe_d'Huez-1.xhtml":

    File name contains following non ascii characters: '. You want to change the name of the file.

    WARNING (PKG-012) to "Hetgeheimfietsen.epub/OEBPS/De_Alpe_d'Huez-2.xhtml":

    File name contains following non ascii characters: '. You want to change the name of the file.

    Check the finish with warnings or errors!

    In the file Toc delete the second "ol", as well as closing like Epubcheck duplicate codes

        the one after the other (delete the other)

    1. When you use Device.device.os, it throws error #1079: native methods are not allowed in the loaded code.

      Hi all

      When I tried to use the Device.device.OS to get the string from the bone. It is compiled smoothly. But it throws error when the application started on my desk.

      Error #1079: Native methods are not allowed in the loaded code.

      It does not error in the emulator, but he did not get the chain of the OS.

      Someone knows how to use the device class? Is it still not currently supported?

      Thank you very much!

      Error #1079: Native methods are not allowed in the loaded code.

      This error is thrown on the desktop because your qnx - air.swc is probably in the process of fusion as code instead of being tied to your project as external. The reason who need to be external is that it contains classes that exist in the execution of AIR in the Simulator and not in the AIR runtime on your desktop. The device classes use the custom air extensions we wrote to get the properties of the device.

      If you want just the operating system, you can also use the Capabilities.os, which is a standard API Flash Player and does not require the use of custom extensions.

      My guess on why it does not work on the device thus is that the qnx - air.swc is not defined externally. Return to externally set and run it in the Simulator.

      Hope that helps

      Julian

    2. ORA-00984 column not allowed here. Help, please.

      Hey, I made a table;


      CREATE TABLE borrower)
      BorId VARCHAR2 (5) NOT NULL,
      BorName VARCHAR2 (20).
      BorMaxBooks NUMBER (10),
      KEY elementary SCHOOL (BorId));

      I'm trying to enter values in this table;

      INSERT the borrower VALUES)
      001, 'Jack Jones', 5);

      And I get an error; ORA-00984 column not allowed here. Please can someone help? I tried to change the BorName VARCHAR2 (20) BorName char (20), and all I can think about.

      It should work by specifying your columns like this.

      INSERT INTO Borrower (BorId, BorName, BorMaxBooks)
      VALUES (001, 'Jack Jones', 5);
      

      Sitjà.

    3. Database trigger - PL/SQL: ORA-00984: column not allowed here

      I am trying to create a trigger that will update a table of audit used when a row is changed. Using a sequence number to assign an identifier unique to each line as it is created. Need to capture the user ID, date modified and action (update), the image of the front line.
      CREATE SEQUENCE emp_audit_seq START WITH 10;                
      Create table emp (
         empno       NUMBER(4)      Primary Key,
         ename       VARCHAR2(10),
         job            VARCHAR2(9),
         mgr           NUMBER(4),
         hiredate     DATE,
         sal             NUMBER(7,2),
         comm        NUMBER(7,2),
         deptno       NUMBER(2));
      CREATE TABLE emp_audit   (
           audit_uid          NUMBER(15)      Primary Key,
           change_date          DATE,
           change_user          VARCHAR2(30),
           action                  CHAR(1),
           empno                  NUMBER(4),
           ename                  VARCHAR2(10),          
           job               VARCHAR2(9),
           mgr               NUMBER(4),
           hiredate          DATE,
           sal               NUMBER(7,2),
           comm                  NUMBER(7,2),
           deptno                  NUMBER(2));
      CREATE OR REPLACE TRIGGER trig_emp_audit
        BEFORE UPDATE ON emp
        FOR EACH ROW
      BEGIN
        INSERT INTO emp_audit
          VALUES(emp_audit_seq.nextval, change_date, change_user, action, :old.empno, :old.ename, :old.job, :old.mgr, :old.hiredate, :old.sal, :old.comm, deptno);
      END;
      /
      
      Warning: Trigger created with compilation errors.
      
      SQL> show errors
      Errors for TRIGGER TRIG_EMP_AUDIT:
      
      LINE/COL ERROR
      -------- -----------------------------------------------
      2/3      PL/SQL: SQL Statement ignored
      3/149    PL/SQL: ORA-00984: column not allowed here
      Can someone help to help me find what I'm doing wrong with the trigger?

      Published by: LostNoob on August 25, 2012 14:24

      First of all, when you write an INSERT statement, it is always good for the columns that you insert in the list. Which makes the code easier to follow - you do not have separately pull toward the top of the table definition to know what order of columns is inserted. And it makes the code easier to manage because the declaration become invalid if you add a new column to the table in the future.

      Second, CHANGE_DATE, CHANGE_USER and ACTION are not (probably) functions and are not local variables so it is not supposed to use them in an INSERT statement. You need to write code or to take advantage of the existing functions to fill in these columns. I suppose, for example, that you want to use SYSDATE to fill the CHANGE_DATE and the USER to fill the column CHANGE_USER. My guess is that ACTION must always be a 'U' for UPDATE.

      Thirdly, it seems that you left the: old man on the DEPTNO column.

      Put them all together, you would have something like

      CREATE OR REPLACE TRIGGER trig_emp_audit
        BEFORE UPDATE ON emp
        FOR EACH ROW
      BEGIN
        INSERT INTO emp_audit(
            audit_uid,
            change_date,
            change_user,
            action,
            enpno,
            ename,
            job,
            mgr,
            hiredate,
            sal,
            comm,
            deptno )
          VALUES(
            emp_audit_seq.nextval,
            sysdate,
            user,
            'U',
           :old.empno,
           :old.ename,
           :old.job,
           :old.mgr,
           :old.hiredate,
           :old.sal,
           :old.comm,
           :old.deptno);
      END;
      / 
      

      Justin

    4. ORA-00976: virtual specified or operator not allowed here - (11g)

      This ora error occurs on one of my test environment.

      ORA-00976: virtual specified or operator not allowed here

      This happens in one of the plsql pkg, which has no compilation errors. and works perfectly well in other environments.

      The only difference I noticed is what error in DB, which is 11g - 11.2.0.3
      and other environments that are in good shape is 10g - 10.2.0.5

      Overall of the function where the error is, there is one thing which I suspect (but not sure)
      It is CONNECT BY LEVEL, is used in a query. This could be a problem in 11g?
      If not, any help / troubleshooting tips that will be greatly appreciated. !

      -Thank you,

      I can reproduce your error on my 11.2.0.3 instance. Looks like the bug number 13496250 introduced in the 11.2.0.3.

      John

    Maybe you are looking for