本文主要是介绍Hive count(*) count(1) count(c1) 区别,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1 count(c1) 不统计c1=NULL的记录,但统计c1='' 和 c1=' ' 空格的记录!
2 count(*) = count(1) = count(10000) = count(c1) + count(*) where c1 is null
3 count(数字),这个数字可以设置任意的正整数,不影响结果。
select count(1)from (select 1 as c1 union allselect '' as c1union allselect null as c1) t1 -- 3 行select count(1)from (select 1 as c1 union allselect '' as c1union allselect ' ' as c1 -- 空格union allselect null as c1) t1 -- 4 行--------------select count(*)from (
这篇关于Hive count(*) count(1) count(c1) 区别的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!