select distinct id from tmp_boss_dap.day_hour; NULL lai select count(distinct id), count(id), count(*), count(1) from tmp_boss_dap.day_hour; 1 1 2 2
结论:
1. count(字段),count(distinct 字段) 不算 NULL
2. distinct 字段 ,count(*), count(1) 算 NULL
select distinct id from tmp_boss_dap.day_hour; NULL lai select count(distinct id), count(id), count(*), count(1) from tmp_boss_dap.day_hour; 1 1 2 2
结论:
1. count(字段),count(distinct 字段) 不算 NULL
2. distinct 字段 ,count(*), count(1) 算 NULL