1、根据指定的列统计记录总数,不包含重复的记录,不包括NULL或空的值:count(distinct 列名)
COUNT(DISTINCT user_id) AS active_users
`单行代码`