Solved

Sub Query in PL/SQL

Posted on 2012-04-04
4
500 Views
Last Modified: 2012-07-30
Hi Experts

How would I rewrite this query to sum  NETPRICE on WOLINENUMBER and INVOICENUMBER


select * from vw_rpt_preinvoice t

WHERE (WOLINENUMBER = 1 and INVOICENUMBER = '24-127345400')
0
Comment
Question by:December2000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 37806439
Have some sample data and expected results?

Off the top of my head a normal SUM(NETPRICE ) function and a group by on WOLINENUMBER and INVOICENUMBER:


select WOLINENUMBER , INVOICENUMBER, sum(NETPRICE)
from vw_rpt_preinvoice t
WHERE (WOLINENUMBER = 1 and INVOICENUMBER = '24-127345400')
group by WOLINENUMBER , INVOICENUMBER;
0
 
LVL 13

Expert Comment

by:Ashok
ID: 37806459
select Sum(NetPrice) from vw_rpt_preinvoice t
WHERE (WOLINENUMBER = 1 and INVOICENUMBER = '24-127345400')
0
 

Author Comment

by:December2000
ID: 37806464
Thanks, I just wanted to make that harder than it was.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
This video shows how to recover a database from a user managed backup
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question