create table #Test (id int, price decimal(5,2))
insert into #Test(id, price)
values(1,12.4),(2,10.5)
select sum(price) from #Test with(nolock) where id = 3 --返回null
select sum(price) from #Test with(nolock) where id = 3 group by id --什么也不返回
如上的sql,为什么在分组以后,聚合函数没有任何返回值,而不分组却返回null?经过where过滤后不都没有数据吗?