Solved

Sub Query in PL/SQL

Posted on 2012-04-04
4
492 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
4 Comments
 
LVL 76

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now