Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Help

Re: SQL Help

From: <beowolf35_at_my-dejanews.com>
Date: Thu, 06 May 1999 19:06:08 GMT
Message-ID: <7gsp6q$dve$1@nnrp1.deja.com>


I believe that you have to use the group by expression and put all the variables into it. This should resolve your sum issue as well.

    Nick Piscione

In article <3731D19A.46892E54_at_sympatico.ca>,   Marc Mazerolle <informaze_at_sympatico.ca> wrote:
> Oracle version ? Does this query work in SQL*Plus ?
>
> Oracle 7 : inline views are not allowed in PL/SQL....
>
> Regards,
>
> Marc Mazerolle
>
> Paul Davies wrote:
>
> > I have the following query:
> >
> > BEGIN
> > select
> > sum(
> > (M_N + M_B + (K_N* cd) + (C_B * cd))
> > * (7 / cnt)
> > )
> > into
> > sold
> >
> > from A_REQ o, CAM c,(select CAM_ID,count(*) cnt from
> > CAM_DAY) CAM_DAY
> > where
> > c.CAM_ID = CAM_DAY.CAM_ID (+)
> > and .........
> >
> > *
> > When I run the query I get this error:
> >
> > ERROR at line 1:
> > ORA-00937: not a single-group group function
> > ORA-06512: at "SYSTEM.GETSOLD", line 25
> > ORA-06512: at line 1
> >
> > caused by the subquery (select CAM_ID, count(*) cnt from CAM_DAY)
> >
> > I've also seen this error when I use other aggregate functions like sum().
> > I'm new to Oracle and would appreciated it if someone could enlighten me as
> > to what it means and how I can stop it.
> >
> > Thanks
> >
> > Paul
>
>

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Thu May 06 1999 - 14:06:08 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US