Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sqlchiq
Posting Yak Master
133 Posts |
Posted - 2008-09-05 : 17:02:56
|
| lets say I doselect avg(somecolumn)from thethingthething:somecolumn1210is the average (1+2+0+10)/4or does it do (1+2+10)/3?? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-09-05 : 17:08:19
|
| It took me about 45 seconds to type this and test it, longer than it'll take to post a thread:create table thething(somecolumn int null)insert into thething values(1)insert into thething values(2)insert into thething values(NULL)insert into thething values(10)select avg(somecolumn)from thethingdrop table thethingIt returns 4.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-06 : 23:36:24
|
| it avoids NULL values. This is clearly defined in books online.http://doc.ddart.net/mssql/sql70/aa-az_15.htmand if you're having a blank value instead of NULL then that means your field type is of type character.In that case i would like to ask why u r having character field for storing numeric values. |
 |
|
|
|
|
|