- 在 user_log 表中取出第一天登录第二天没有登录的用户ID
id | time |
---|---|
1 | 2019-06-01 |
1 | 2019-06-02 |
2 | 2019-06-01 |
3 | 2019-06-01 |
3 | 2019-06-02 |
4 | 2019-06-01 |
select id from user_log u1 where u1.time="2019-06-01" and not exists(select 1 from user_login u2 where u1.id = u2.id and u2.time = '2019-06-02')