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!

COUNT(NULL) =0 Why ?

Data BoyMay 23 2008 — edited May 24 2008
Using Aggregating Functions Like MIN,MAX,AVG,SUM on null values
the Result is Null ..But for Count it will return 0 ..Can anybody tell specific reason for this


for eg: select min(null) from dual -- > null
select max(null) from dual --> null
---
select count(null) from dual -->null or 0 ?

and now let us take this example

select count('a') from dual; --> 1
select count(null) from dual --> 0 ? it shud atleast return 1
is not considered as value in dual table ?



i dont understand why -- select count(null) from dual; is returning 0 ;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 21 2008
Added on May 23 2008
11 comments
3,245 views