Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    10

    Unanswered: not a single-group group function-HELP???

    I keep getting a not a single-group group function error when i try to run this query.

    SELECT ApplicationNo,COUNT(*),AVG(B.Modulesize)
    FROM APPLICATIONMODULE A,MODULE B
    WHERE A.ModuleNo = B.Moduleno;

    Here are the tables that are used:
    CREATE TABLE MODULE
    (Moduleno Number
    constraint pk_no PRIMARY KEY,
    Modulename VARCHAR2(60) NOT NULL,
    Modulesize Number
    constraint BD_Modulesize CHECK(modulesize>=0),
    Designerids Varchar(5)
    constraint FK_Designerids references Designer(Designerid));


    CREATE TABLE APPLICATIONMODULE
    (ApplicationNo Varchar2(5)
    constraint FK_ApplicationNo references Application(ApplicationNo),
    ModuleNo number
    constraint FK_Moduleno references Module(Moduleno),
    CONSTRAINT PK3_TAB PRIMARY KEY(ApplicationNo,ModuleNo));


    Here is the error as it is shown:

    SELECT ApplicationNo,COUNT(*),AVG(B.Modulesize)
    *

    ERROR at line 1:
    ORA-00937: not a single-group group function

    Does anybody know where iam going wrong and how to resolve this? Thank you in advance.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    SELECT ApplicationNo,COUNT(*),AVG(B.Modulesize)
    FROM APPLICATIONMODULE A,MODULE B
    WHERE A.ModuleNo = B.Moduleno
    GROUP BY ApplicationNo
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Mar 2004
    Posts
    10
    thank you very much for the quick reply. your help was much appreciated, thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •