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: not a single-group group function ?

Re: not a single-group group function ?

From: Steve McDaniels <steve.mcdaniels_at_sierra.com>
Date: Fri, 29 Oct 1999 11:18:20 -0700
Message-ID: <7vcog3$19s$1@plo.sierra.com>


why the TO_CHAR?

select renewal_date, count(*) from foreign_worker_master group by renewal_date

or better yet

select substr(to_char(renewal_date,'YYYY-DD-MM'),1,10) renewal_date, count(*) from ... group by to_char(renewal_date,'YYYY-DD-MM');

remember that there is a time component to these date fields.

Jeremy Russell <Jeremy.Russell_at_usa.net> wrote in message news:3816dab7.124182865_at_news.earthlink.net...
> Basically, anything in your SELECT list that isn't an aggregate must
> also appear in a GROUP BY clause. Therefore try this:
>
> SELECT to_char(renewal_date), count(*)
> FROM foreign_worker_master
> GROUP BY to_char(renewal_date);
>
> HTH
>
> JR
>
> On Wed, 27 Oct 1999 03:59:01 GMT, javanewbie_at_my-deja.com wrote:
>
> >when i do this in the oracle, it says :-
> >
> >select to_char(renewal_date),count(*)
> > from foreign_worker_master";
> >
> >question 1 : what's wrong ?
> >
> >executeQuery() Failed:
> > Message: ORA-00937: not a single-group group function
> >
> > Vendor: 937
> >
> >question 2 : how do i group all the dates that begin with
> >
> >28-NOV-99
> >30_NOV-99
> >
> >to be 1 group ?
> >
> >
> >Sent via Deja.com http://www.deja.com/
> >Before you buy.
>
>
Received on Fri Oct 29 1999 - 13:18:20 CDT

Original text of this message

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