Please help -
Why can I get this sql to work?
SELECT Count(dsd.price) Total
, dsd.reporting_date
, dsd.reporting_state_type
, dsd.requisition_id Order_id
, round((sum(decode(dsd.reporting_state_type,'SHIPMENT',dsd.price, 0)) - sum(decode(dsd.reporting_state_type,'RETURN_RECEIPT',dsd.price, 0))) Net_Orders
from dw_sales_data dsd, dw_programs dp
where dsd.program_id = dp.program_id
and dsd.program_id = '4387300'
group by dsd.reporting_date, Order_id, dsd.reporting_state_type, Net_Orders_Com, Net_Orders_Ret, Net_Orders;