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: Whats wrong with this select statement???

Re: Whats wrong with this select statement???

From: Abey Joseph <abeyj_at_netzero.net>
Date: 2000/03/09
Message-ID: <8a8lrg$p3e$1@slb6.atl.mindspring.net>#1/1

Liam,

        Why not try a sub query? I haven't tested this but worth a try...

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)+10 FROM inventory)

<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 Thu Mar 09 2000 - 00:00:00 CST

Original text of this message

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