Solved

Sub Query in PL/SQL

Posted on 2012-04-04
4
489 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
Comment Utility
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
Comment Utility
select Sum(NetPrice) from vw_rpt_preinvoice t
WHERE (WOLINENUMBER = 1 and INVOICENUMBER = '24-127345400')
0
 

Author Comment

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

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Read about achieving the basic levels of HRIS security in the workplace.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

744 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

8 Experts available now in Live!

Get 1:1 Help Now