1、正常GROUP汇总去重写法
SELECT COUNT(1) FROM(
SELECT COUNT(1) FROM cookie_used_t WHERE clevel>=0 AND clevel<4 GROUP BY cuid
)t;
2、正常DISTINCT 汇总去重写法
SELECT COUNT(1) FROM(
SELECT DISTINCT cuid FROM cookie_used_t WHERE clevel>=0 AND clevel<4
)t;
SELECT COUNT(1) FROM(
SELECT DISTINCT(cuid) FROM cookie_used_t WHERE clevel>=0 AND clevel<4
)t;
3、DISTINCT 汇总去重改造
SELECT COUNT(DISTINCT cuid) FROM cookie_used_t WHERE clevel>=0 AND clevel<4;