•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 401,573 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,339 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Views: 1878 | Replies: 1
![]() |
•
•
Join Date: Apr 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 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;
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;
•
•
Join Date: Mar 2005
Location: Nebraska, U.S.
Posts: 187
Reputation:
Rep Power: 4
Solved Threads: 4
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
![]() |
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- error while trying to retrieve text for error ora 01019 (Oracle)
- error while trying to retrieve text for error ora 01019 (ASP.NET)
- SQP *PLUS Trouble (Database Design)
- Recreate Controlfile in Oracle (Oracle)
Other Threads in the MySQL Forum
- Previous Thread: Too many connections error
- Next Thread: DB design help


Linear Mode