WITH tmp AS
(SELECT null as col1
union all
SELECT 2 as col1
union all
SELECT 4 as col1
)
SELECT avg(1) from tmp
结果是3;
WITH tmp AS
(SELECT null as col1
union all
SELECT 2 as col1
union all
SELECT 4 as col1
)
SELECT count(col1) from tmp
结果是:2
但是SELECT count(1) from tmp
结果是:3