Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Count() PROBLEM

Status
Not open for further replies.

lasd

Programmer
Jan 14, 2005
48
IE
Hi
Hopefully someone can help me. I need to count the total number of items in a list of numbers ... I am just going to post the select statement i am using. in the code below i am selecting segment 1, amount, segment2 and amount. I want to put a total at the end of my report of the number of entries for segment 1 and segment 2... segment 1 and 2 are numerical columns.. here is an eg of what i want to do.


segment1
1
1
2
2

total count= 4


here is my code:

SELECT prh.segment1,
sum(nvl(prl.quantity,0)
* nvl(prl.unit_price,0) )
poh.segment2,
sum(nvl(pol.quantity,0)
* nvl(pol.UNIT_PRICE,0) ,
FROM po_requisition_lines_all prl
, po_requisition_headers_all prh
, per_all_people_f papf
, po_headers_all poh
, po_lines_all pol
, po_req_distributions_all prd
, po_distributions_all pod


thanks so so so so much for help in advance.
Lasd
 
Testing the SQL in TOAD...and transferring into Oracle Report Builder.... this isn't all of my code just the select statement
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top