create table temp(tat string);
insert into temp values(null),('111'),('222'),('333'),('');
a: select count(1) FROM temp;
b: select count(*) FROM temp;
c: select count(tat) FROM temp;
d: select sum(tat) from temp;
e: select avg(tat) from temp;
f: select min(tat) from temp;
g: select max(tat) from temp;
h: select * from temp order by tat desc;
结果:
a: 5
b: 5
c: 4
d: 666
e: 222
f: ''(空字符串)
g: 333
h: 333,222,111,'',null
结论:
针对字段的函数计算count(字段),min()会去除null值,但不会去除’'值
但是对于count(1)和count(*)都能识别出来
最后
以上就是酷酷帆布鞋最近收集整理的关于大数据hive篇--NULL和空值区别的全部内容,更多相关大数据hive篇--NULL和空值区别内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复