0

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;

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by stupidenator
0
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;

ORA-00907: missing right parenthesis
Cause: A left parenthesis has been entered without a closing right parenthesis, or extra information was contained in the parentheses. All parentheses must be entered in pairs.
Action: Correct the syntax and retry the statement.

It looks like you had an extra left parentheses

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.