--窗口函数实现,不过只筛选新用户的登录次数,老客的话wei
select
t1.date,
count(t1.date)
from
(select
t.*,
row_number() over(partition by t.user_id order by t.date) rn
from
(
select
user_id,date
from
login
group by user_id,date
)t)t1
where t1.rn=1
group by date