Newbie Needs Help - How to Calc Average without Aggregate Function [message #38577] |
Sun, 28 April 2002 07:24 |
Ms. Newbie
Messages: 2 Registered: April 2002
|
Junior Member |
|
|
This question has me stumped - it's probably really easy but not for me! It reads:
"Create an anonymous PL/SQL block that will report the average standard price for all items in the price table. You must NOT use any SQL aggregate functions or cursor FOR loops. You should use explicit cursor(s) and numeric output must be limited to 2 decimal places."
The column name is STDPRICE and the table name is price. I know how to declare the cursor, the PL/SQL table if needed - not sure what variables to use and how to create the loop to add all the column values. And can I use cursor_name%ROWCOUNT to divide by to get the average?
Totally frustrated - kindly need help. Personally I say if the Oracle Gods made Aggregate Functions we should use them!!!!!!!!! Thanks, Ms. Newbie (name withheld to protect my identity from prof! ha!)
|
|
|
|