表结构如图
需要统计日活跃用户数量,请问应该怎么写sql
假设你按日分表
select count(distinct login_uid) from table;
如果所有日子的数据都在表上的话,
select DATE_FORMAT(login_time,'%Y-%m-%d'), count(distinct login_uid) from table group by DATE_FORMAT(login_time,'%Y-%m-%d')