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: SubQuery Question

Re: SubQuery Question

From: Vikas Chahal <vikas.chahal_at_gmail.com>
Date: 18 Feb 2005 05:39:13 -0800
Message-ID: <1108733953.606558.116850@f14g2000cwb.googlegroups.com>


Hi,

the query below should solve ur problem assuming that work & task table had a relation based on order_id

for count of less than 4

select work_order.order_id,
sum(task.order_id)
from work_order, task
where work_oder.order_id=task.order_id
group by work_order
having count(*) < 4

& for count of greater than 4

select work_order.order_id,
sum(task.order_id)
from work_order, task
where work_oder.order_id=task.order_id
group by work_order
having count(*) >4 Received on Fri Feb 18 2005 - 07:39:13 CST

Original text of this message

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