#查询每种手机型号的用户数,除了要根据手机型号分组外,还需要根据手机号去重
SELECT
mobileModel,
COUNT(DISTINCT mobile) con
FROM
loginLog
WHERE
mobileModel IS NOT NULL
GROUP BY
mobileModel ORDER BY con desc
根据多个字段分组
最新推荐文章于 2022-07-29 08:47:20 发布
#查询每种手机型号的用户数,除了要根据手机型号分组外,还需要根据手机号去重
SELECT
mobileModel,
COUNT(DISTINCT mobile) con
FROM
loginLog
WHERE
mobileModel IS NOT NULL
GROUP BY
mobileModel ORDER BY con desc