December 10, 2014 Distinct, AVG , COUNT how all behaves if null value exist in table These are all basics but when asked in interview we make mistake. select * from #temp select AVG(id) from #temp [5/3 or 5/5] select COUNT(*) from #temp [5 or 3] select distinct(id) from #temp [1,2 or 1,2,null] test 0