[quoted text, click to view] > When you do average of a column that includes null values, does it ignore
> the rows with null or does it not ?
NULLs are ignored.
[quoted text, click to view] > If it does not, how can we include it
> ..i mean if we have 5 rows with one null value, how can we avg with 4 and
> also average with 5.. Thanks
I'm not exactly sure what you want but you might experiment with the
following examples:
--exclude nulls
SELECT AVG(Col1) FROM MyTable
SELECT SUM(Col1) / COUNT(Col1) FROM MyTable
--exclude nulls from SUM but include in count
SELECT SUM(Col1) / COUNT(*) FROM MyTable
--
Hope this helps.
Dan Guzman
SQL Server MVP
[quoted text, click to view] "Hassan" <fatima_ja@hotmail.com> wrote in message
news:OoktTZb2EHA.2568@TK2MSFTNGP10.phx.gbl...
> When you do average of a column that includes null values, does it ignore
> the rows with null or does it not ? If it does not, how can we include it
> ..i mean if we have 5 rows with one null value, how can we avg with 4 and
> also average with 5.. Thanks
>
>