Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SubQuery Question
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