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

Home -> Community -> Usenet -> c.d.o.server -> Re: help please

Re: help please

From: Yosi Greenfield <ygreenfield_at_compuserve.com>
Date: Wed, 27 Oct 1999 17:08:21 -0400
Message-ID: <381769C5.C43999FA@compuserve.com>


Add the line

        Group by store_id

to the end of the query. When you request a column and a group function, you've got to tell Oracle to group by the column.

HTH, Yosi

Joe D wrote:

> I have this query:
>
> SQLWKS> select store_id Store, sum(amount+freight) Total from
> REPORT_TRANSACTION_VIEW
> 2> where TRANSACTION_DATE >= 936158400 and TRANSACTION_DATE <=
> 938664000
> 3> and transaction_type = '1'
> 4> and STORE_ID =
> 5> (select store_id from STORE SS where SS.KEY_STORE_SEQID =
> 6> (select V.KEY_STORE_SEQID from REPORT_STORES_VIEW V where NAME =
> 'Tiger Toy Store'))
> 7> ;
>
> When I run it, I get this error:
>
> and STORE_ID =
> *
> ORA-00937: not a single-group group function
>
> how do I fix this? I want the output to include the store_id field.
>
> TIA
>
> Joe D
Received on Wed Oct 27 1999 - 16:08:21 CDT

Original text of this message

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