Solved

Sub Query in PL/SQL

Posted on 2012-04-04
4
498 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

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.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

732 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