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: can I put a Select in my Select?

Re: can I put a Select in my Select?

From: Mike Cohen <mcohen_at_attbi.com>
Date: 6 Feb 2003 11:11:21 -0800
Message-ID: <9a742dd3.0302061111.27919255@posting.google.com>


Ron - yes I received Group By errors on the Sum and Count functions within the nested selects. The exact error messages are:

"ORA-00979: not a GROUP BY expression"

Ron Reidy <rereidy_at_indra.com> wrote in message news:<3E419D74.10307_at_indra.com>...
> See below ...
>
> Mike Cohen wrote:
> > Hello,
> >
> > I was wondering if I can nest a Select statement within my Select statement?
>
> yes
>
> >
> > Thank you very much!
> >
> > Mike
> >
> > The code I'm trying to get work is as such:
>
> Did you try it? Was there an error? What was it?
>
> >
> > SELECT
> > rcm.MSA,
> > count(ttt.transaction_id),
> > sum(ttt.SALE_PRICE),
> > round((select
> > sum(ttt3.SALE_PRICE)
> > from
> > t_transaction ttt3
> > t_seller tsp3
> > where
> > ttt3.close_ts != 0
> > and tsp3.create_ts > 1004601600
> > and tsp3.create_ts < 1038733200
> > and tsp3.id=ttt3.id
> > )
> > /
> > (select
> > count(ttt2.transaction_id)
> > from
> > t_transaction ttt2,
> > t_seller tsp2
> > where
> > ttt2.d_actual_close_ts != 0
> > and tsp2.create_ts > 1004601600
> > and tsp2.create_ts < 1038733200
> > and tsp2.id=ttt2.id
> > )
> > ) "AVERAGE"
> > FROM
> > claritas_mhv rcm,
> > t_seller tsp,
> > t_transaction ttt
> > WHERE
> > ttt.status in (600,700)
> > and ttt.property = 'S'
> > and tsp.create_ts > 1004601600 /* 11.1.01 */
> > and tsp.create_ts < 1038733200 /* 11.1.02 */
> > and rcm.msa is not null
> > and rcm.zip_code=tsp.ZIP_CODE
> > and tsp.id=ttt.id
> > GROUP BY
> > rcm.MSA
Received on Thu Feb 06 2003 - 13:11:21 CST

Original text of this message

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