Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Scalar Correlated Subquery Problem

569919Feb 17 2010 — edited Feb 18 2010
SELECT a.unit_id
, NVL((
SELECT COUNT(*)
FROM (
SELECT b.unit_id
, b.rfq_id
, b.vendor_id
FROM RFQ_DISPATCHED b
WHERE b.unit_id a.unit_id
AND b.vendor_id = a.vendor_id
AND b.rfq_id = a.rfq_id
GROUP BY a.business_unit, a.rfq_id, a.vendor_id)),0) AS bid_qty
FROM rfq_disp_hdr a
WHERE a.unit_id = '00021'

Oracle won't let me do this. Is it because it's correlated to a Query View? I know I can just create a view as a work around and then do a select on the view but any other suggestions on how to handle it?

Thanks all!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 18 2010
Added on Feb 17 2010
5 comments
1,465 views