QUERY:
SELECT
_column_ as segment,
count(*) as count,
(Count(_column_)* 100 / (Select Count(*) From _table_)) as percentage
FROM
_table_
GROUP BY _column_
ORDER BY _column_
输出:
[{ segment: null, count: 308, percentage: 0 },
{ segment: 1, count: 16346, percentage: 40 },
{ segment: 2, count: 13186, percentage: 32 },
{ segment: 3, count: 10309, percentage: 25 }]
为什么此查询会为null
段返回0%?