Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Help with subquery

Help with subquery

From: <slundeen_at_sigatl.com>
Date: Thu, 31 May 2001 18:28:01 GMT
Message-ID: <3b168a5f.22666192@news.easynews.com>

I am having difficulty with what should be a simple query. I have two tables; Inventory Parts and Customer Orders. I want select the total Qty_On_Order for all parts. I assume I need to do a SELECT on the parts, with a subquery to sum the orders. Is there a better way?

In my statement below, I cannot get it to return all item numbers unless I hard code the number. I cannot replace the '11508' with i.part_no.

select i.part_no, i.description, ooo.Qty_On_Order from inventory_part_tab i,
(select col.part_no,sum(col.Qty_On_Order) as Qty_On_Order from ifsapp.customer_order_line_tab col
 where col.part_no = '11108' group by col.part_no) ooo where i.part_no = ooo.part_no

Make sense? Thanks. Received on Thu May 31 2001 - 13:28:01 CDT

Original text of this message

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