Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to calculate avg of a field excluding null values

438932Dec 10 2007 — edited Dec 10 2007
Hi all,
I have a table with 2 columns. One is "Date" and other is "Amount". My "Amount" contains alos null values. if i calculate the average of this column with Avg fucntion then it include the null values.Now i want to calculate average of this column in such a way that exclude null values.
Date       Amount
1/1/07        100
2/1/07        200
3/1/07        Null
4/1/07        150
5/1/07         0
i want to calculate the average with this formula 450/3.Contain only values not even "0".
any help would be appriciated...

Regards

Message was edited by:
53637
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 7 2008
Added on Dec 10 2007
9 comments
6,563 views