Scalar Correlated Subquery Problem
569919Feb 17 2010 — edited Feb 18 2010SELECT 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!!