Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Whats wrong with this select statement???
Try This:
select s.store_nm
from store s, inventory i
where s.store_id = i.store_id
and i.on_hand_qty > ((select avg(on_hand_qty) from inventory) + 10);
NY
"Vincenzo Scervo" <scervo_at_praxis.it> wrote in message
news:10p3q21$a57$1_at_fe2.cs.interbusiness.it...
> Try to put the avg function in a having clause instead.
>
> --
> VIncenzo Scervo
>
> <liam_2e_at_my-deja.com> wrote in message news:8a8jt2$neo$1_at_nnrp1.deja.com...
> > SQL> select s.store_nm
> > 2 from store s, inventory i
> > 3 where s.store_id = i.store_id and i.on_hand_qty > (avg
> > (i.on_hand_qty) + 10);
> > where s.store_id = i.store_id and i.on_hand_qty > (avg(i.on_hand_qty) +
> > 10)
> > *
> > ERROR at line 3:
> > ORA-00934: group function is not allowed here
> >
> > Thanks for the help
> > Liam
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>
Received on Mon Mar 13 2000 - 00:00:00 CST
![]() |
![]() |