这样两条查询语句,得到的记录条数为什么不一样呢?
select distinct name
from studentselect count(name)as name
from
(
select distinct name
from student
)temp
select distinct name
from studentselect count(name)as name
from
(
select distinct name
from student
)temp
from
(
select distinct name
from student
)temp-->聚合函数呢.会忽略NULL的.
这样试试
select distinct name
from student where name is not nullselect count(name)as name
from
(
select distinct name
from student where name is not null
)temp
要么是数据变了,要么是有null值
完全没理解歪了聚合函数不对NULL进行计算.
是NULL的问题
谢谢各位
俺分少
大家都这么热情
不知道给谁好
一人给一点意思一下吧
不要嫌少